vserver 1.9.5.x5
[linux-2.6.git] / arch / mips / sgi-ip27 / ip27-smp.c
index 1e5ce4c..17f768c 100644 (file)
@@ -8,6 +8,7 @@
  */
 #include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/nodemask.h>
 #include <asm/page.h>
 #include <asm/processor.h>
 #include <asm/sn/arch.h>
@@ -108,22 +109,22 @@ void cpu_node_probe(void)
        for (i = 0; i < MAXCPUS; i++)
                cpuid_to_compact_node[i] = INVALID_CNODEID;
 
-       numnodes = 0;
+       /*
+        * MCD - this whole "compact node" stuff can probably be dropped,
+        * as we can handle sparse numbering now
+        */
+       nodes_clear(node_online_map);
        for (i = 0; i < MAX_COMPACT_NODES; i++) {
                nasid_t nasid = gdap->g_nasidtable[i];
                if (nasid == INVALID_NASID)
                        break;
                compact_to_nasid_node[i] = nasid;
                nasid_to_compact_node[nasid] = i;
-               numnodes++;
+               node_set_online(num_online_nodes());
                highest = do_cpumask(i, nasid, highest);
        }
 
-       printk("Discovered %d cpus on %d nodes\n", highest + 1, numnodes);
-}
-
-void __init prom_build_cpu_map(void)
-{
+       printk("Discovered %d cpus on %d nodes\n", highest + 1, num_online_nodes());
 }
 
 static void intr_clear_bits(nasid_t nasid, volatile hubreg_t *pend,
@@ -155,13 +156,10 @@ void __init prom_prepare_cpus(unsigned int max_cpus)
 {
        cnodeid_t       cnode;
 
-       for (cnode = 0; cnode < numnodes; cnode++)
+       for_each_online_node(cnode)
                intr_clear_all(COMPACT_TO_NASID_NODEID(cnode));
 
-       /* Master has already done per_cpu_init() */
-       install_ipi();
-
-       replicate_kernel_text(numnodes);
+       replicate_kernel_text();
 
        /*
         * Assumption to be fixed: we're always booted on logical / physical