]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/cpu/proc.c
x86: convert cpuinfo_x86 array to a per_cpu array
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / cpu / proc.c
index 879a0f789b1e223026ec820c873cca43a70dec89..2d42b414b7779b37604d9c564f044642c8cb0832 100644 (file)
@@ -85,12 +85,13 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                /* nothing */
        };
        struct cpuinfo_x86 *c = v;
-       int i, n = c - cpu_data;
+       int i, n = 0;
        int fpu_exception;
 
 #ifdef CONFIG_SMP
        if (!cpu_online(n))
                return 0;
+       n = c->cpu_index;
 #endif
        seq_printf(m, "processor\t: %d\n"
                "vendor_id\t: %s\n"
@@ -175,11 +176,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
-       return *pos < NR_CPUS ? cpu_data + *pos : NULL;
+       if (*pos == 0)  /* just in case, cpu 0 is not the first */
+               *pos = first_cpu(cpu_possible_map);
+       if ((*pos) < NR_CPUS && cpu_possible(*pos))
+               return &cpu_data(*pos);
+       return NULL;
 }
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 {
-       ++*pos;
+       *pos = next_cpu(*pos, cpu_possible_map);
        return c_start(m, pos);
 }
 static void c_stop(struct seq_file *m, void *v)