Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[linux-drm-fsl-dcu.git] / arch / alpha / kernel / setup.c
index 254c507a608c076f9e09aa8acb83edfea90d2975..d352c2b05f1a245503e5af698b4d8ef6a7858aeb 100644 (file)
@@ -19,9 +19,8 @@
 #include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
-#include <linux/tty.h>
+#include <linux/screen_info.h>
 #include <linux/delay.h>
-#include <linux/config.h>      /* CONFIG_ALPHA_LCA etc */
 #include <linux/mc146818rtc.h>
 #include <linux/console.h>
 #include <linux/cpu.h>
@@ -67,6 +66,7 @@ static struct notifier_block alpha_panic_block = {
 
 
 struct hwrpb_struct *hwrpb;
+EXPORT_SYMBOL(hwrpb);
 unsigned long srm_hae;
 
 int alpha_l1i_cacheshape;
@@ -112,10 +112,9 @@ unsigned long alpha_agpgart_size = DEFAULT_AGP_APER_SIZE;
 #ifdef CONFIG_ALPHA_GENERIC
 struct alpha_machine_vector alpha_mv;
 int alpha_using_srm;
+EXPORT_SYMBOL(alpha_using_srm);
 #endif
 
-#define N(a) (sizeof(a)/sizeof(a[0]))
-
 static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long,
                                               unsigned long);
 static struct alpha_machine_vector *get_sysvec_byname(const char *);
@@ -123,7 +122,7 @@ static void get_sysnames(unsigned long, unsigned long, unsigned long,
                         char **, char **);
 static void determine_cpu_caches (unsigned int);
 
-static char command_line[COMMAND_LINE_SIZE];
+static char __initdata command_line[COMMAND_LINE_SIZE];
 
 /*
  * The format of "screen_info" is strange, and due to early
@@ -140,6 +139,8 @@ struct screen_info screen_info = {
        .orig_video_points = 16
 };
 
+EXPORT_SYMBOL(screen_info);
+
 /*
  * The direct map I/O window, if any.  This should be the same
  * for all busses, since it's used by virt_to_bus.
@@ -147,6 +148,8 @@ struct screen_info screen_info = {
 
 unsigned long __direct_map_base;
 unsigned long __direct_map_size;
+EXPORT_SYMBOL(__direct_map_base);
+EXPORT_SYMBOL(__direct_map_size);
 
 /*
  * Declare all of the machine vectors.
@@ -240,7 +243,7 @@ reserve_std_resources(void)
        standard_io_resources[0].start = RTC_PORT(0);
        standard_io_resources[0].end = RTC_PORT(0) + 0x10;
 
-       for (i = 0; i < N(standard_io_resources); ++i)
+       for (i = 0; i < ARRAY_SIZE(standard_io_resources); ++i)
                request_resource(io, standard_io_resources+i);
 }
 
@@ -544,7 +547,7 @@ setup_arch(char **cmdline_p)
        } else {
                strlcpy(command_line, COMMAND_LINE, sizeof command_line);
        }
-       strcpy(saved_command_line, command_line);
+       strcpy(boot_command_line, command_line);
        *cmdline_p = command_line;
 
        /* 
@@ -586,7 +589,7 @@ setup_arch(char **cmdline_p)
        }
 
        /* Replace the command line, now that we've killed it with strsep.  */
-       strcpy(command_line, saved_command_line);
+       strcpy(command_line, boot_command_line);
 
        /* If we want SRM console printk echoing early, do it now. */
        if (alpha_using_srm && srmcons_output) {
@@ -918,13 +921,13 @@ get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
 
        /* Search the system tables first... */
        vec = NULL;
-       if (type < N(systype_vecs)) {
+       if (type < ARRAY_SIZE(systype_vecs)) {
                vec = systype_vecs[type];
        } else if ((type > ST_API_BIAS) &&
-                  (type - ST_API_BIAS) < N(api_vecs)) {
+                  (type - ST_API_BIAS) < ARRAY_SIZE(api_vecs)) {
                vec = api_vecs[type - ST_API_BIAS];
        } else if ((type > ST_UNOFFICIAL_BIAS) &&
-                  (type - ST_UNOFFICIAL_BIAS) < N(unofficial_vecs)) {
+                  (type - ST_UNOFFICIAL_BIAS) < ARRAY_SIZE(unofficial_vecs)) {
                vec = unofficial_vecs[type - ST_UNOFFICIAL_BIAS];
        }
 
@@ -938,11 +941,11 @@ get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
 
                switch (type) {
                case ST_DEC_ALCOR:
-                       if (member < N(alcor_indices))
+                       if (member < ARRAY_SIZE(alcor_indices))
                                vec = alcor_vecs[alcor_indices[member]];
                        break;
                case ST_DEC_EB164:
-                       if (member < N(eb164_indices))
+                       if (member < ARRAY_SIZE(eb164_indices))
                                vec = eb164_vecs[eb164_indices[member]];
                        /* PC164 may show as EB164 variation with EV56 CPU,
                           but, since no true EB164 had anything but EV5... */
@@ -950,24 +953,24 @@ get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
                                vec = &pc164_mv;
                        break;
                case ST_DEC_EB64P:
-                       if (member < N(eb64p_indices))
+                       if (member < ARRAY_SIZE(eb64p_indices))
                                vec = eb64p_vecs[eb64p_indices[member]];
                        break;
                case ST_DEC_EB66:
-                       if (member < N(eb66_indices))
+                       if (member < ARRAY_SIZE(eb66_indices))
                                vec = eb66_vecs[eb66_indices[member]];
                        break;
                case ST_DEC_MARVEL:
-                       if (member < N(marvel_indices))
+                       if (member < ARRAY_SIZE(marvel_indices))
                                vec = marvel_vecs[marvel_indices[member]];
                        break;
                case ST_DEC_TITAN:
                        vec = titan_vecs[0];    /* default */
-                       if (member < N(titan_indices))
+                       if (member < ARRAY_SIZE(titan_indices))
                                vec = titan_vecs[titan_indices[member]];
                        break;
                case ST_DEC_TSUNAMI:
-                       if (member < N(tsunami_indices))
+                       if (member < ARRAY_SIZE(tsunami_indices))
                                vec = tsunami_vecs[tsunami_indices[member]];
                        break;
                case ST_DEC_1000:
@@ -1039,7 +1042,7 @@ get_sysvec_byname(const char *name)
 
        size_t i;
 
-       for (i = 0; i < N(all_vecs); ++i) {
+       for (i = 0; i < ARRAY_SIZE(all_vecs); ++i) {
                struct alpha_machine_vector *mv = all_vecs[i];
                if (strcasecmp(mv->vector_name, name) == 0)
                        return mv;
@@ -1055,13 +1058,13 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
 
        /* If not in the tables, make it UNKNOWN,
           else set type name to family */
-       if (type < N(systype_names)) {
+       if (type < ARRAY_SIZE(systype_names)) {
                *type_name = systype_names[type];
        } else if ((type > ST_API_BIAS) &&
-                  (type - ST_API_BIAS) < N(api_names)) {
+                  (type - ST_API_BIAS) < ARRAY_SIZE(api_names)) {
                *type_name = api_names[type - ST_API_BIAS];
        } else if ((type > ST_UNOFFICIAL_BIAS) &&
-                  (type - ST_UNOFFICIAL_BIAS) < N(unofficial_names)) {
+                  (type - ST_UNOFFICIAL_BIAS) < ARRAY_SIZE(unofficial_names)) {
                *type_name = unofficial_names[type - ST_UNOFFICIAL_BIAS];
        } else {
                *type_name = sys_unknown;
@@ -1083,7 +1086,7 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
        default: /* default to variation "0" for now */
                break;
        case ST_DEC_EB164:
-               if (member < N(eb164_indices))
+               if (member < ARRAY_SIZE(eb164_indices))
                        *variation_name = eb164_names[eb164_indices[member]];
                /* PC164 may show as EB164 variation, but with EV56 CPU,
                   so, since no true EB164 had anything but EV5... */
@@ -1091,32 +1094,32 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
                        *variation_name = eb164_names[1]; /* make it PC164 */
                break;
        case ST_DEC_ALCOR:
-               if (member < N(alcor_indices))
+               if (member < ARRAY_SIZE(alcor_indices))
                        *variation_name = alcor_names[alcor_indices[member]];
                break;
        case ST_DEC_EB64P:
-               if (member < N(eb64p_indices))
+               if (member < ARRAY_SIZE(eb64p_indices))
                        *variation_name = eb64p_names[eb64p_indices[member]];
                break;
        case ST_DEC_EB66:
-               if (member < N(eb66_indices))
+               if (member < ARRAY_SIZE(eb66_indices))
                        *variation_name = eb66_names[eb66_indices[member]];
                break;
        case ST_DEC_MARVEL:
-               if (member < N(marvel_indices))
+               if (member < ARRAY_SIZE(marvel_indices))
                        *variation_name = marvel_names[marvel_indices[member]];
                break;
        case ST_DEC_RAWHIDE:
-               if (member < N(rawhide_indices))
+               if (member < ARRAY_SIZE(rawhide_indices))
                        *variation_name = rawhide_names[rawhide_indices[member]];
                break;
        case ST_DEC_TITAN:
                *variation_name = titan_names[0];       /* default */
-               if (member < N(titan_indices))
+               if (member < ARRAY_SIZE(titan_indices))
                        *variation_name = titan_names[titan_indices[member]];
                break;
        case ST_DEC_TSUNAMI:
-               if (member < N(tsunami_indices))
+               if (member < ARRAY_SIZE(tsunami_indices))
                        *variation_name = tsunami_names[tsunami_indices[member]];
                break;
        }
@@ -1211,7 +1214,7 @@ show_cpuinfo(struct seq_file *f, void *slot)
 
        cpu_index = (unsigned) (cpu->type - 1);
        cpu_name = "Unknown";
-       if (cpu_index < N(cpu_names))
+       if (cpu_index < ARRAY_SIZE(cpu_names))
                cpu_name = cpu_names[cpu_index];
 
        get_sysnames(hwrpb->sys_type, hwrpb->sys_variation,