Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / arch / mips / sgi-ip27 / ip27-smp.c
index 08e7914..f15fc93 100644 (file)
@@ -33,7 +33,7 @@ static void alloc_cpupda(cpuid_t cpu, int cpunum)
        nasid_t nasid = COMPACT_TO_NASID_NODEID(node);
 
        cputonasid(cpunum) = nasid;
-       cpu_data[cpunum].p_nodeid = node;
+       sn_cpu_info[cpunum].p_nodeid = node;
        cputoslice(cpunum) = get_cpu_slice(cpu);
 }
 
@@ -140,30 +140,51 @@ static __init void intr_clear_all(nasid_t nasid)
                REMOTE_HUB_CLR_INTR(nasid, i);
 }
 
-void __init plat_smp_setup(void)
+static void ip27_send_ipi_single(int destid, unsigned int action)
 {
-       cnodeid_t       cnode;
+       int irq;
 
-       for_each_online_node(cnode) {
-               if (cnode == 0)
-                       continue;
-               intr_clear_all(COMPACT_TO_NASID_NODEID(cnode));
+       switch (action) {
+       case SMP_RESCHEDULE_YOURSELF:
+               irq = CPU_RESCHED_A_IRQ;
+               break;
+       case SMP_CALL_FUNCTION:
+               irq = CPU_CALL_A_IRQ;
+               break;
+       default:
+               panic("sendintr");
        }
 
-       replicate_kernel_text();
+       irq += cputoslice(destid);
 
        /*
-        * Assumption to be fixed: we're always booted on logical / physical
-        * processor 0.  While we're always running on logical processor 0
-        * this still means this is physical processor zero; it might for
-        * example be disabled in the firwware.
+        * Convert the compact hub number to the NASID to get the correct
+        * part of the address space.  Then set the interrupt bit associated
+        * with the CPU we want to send the interrupt to.
         */
-       alloc_cpupda(0, 0);
+       REMOTE_HUB_SEND_INTR(COMPACT_TO_NASID_NODEID(cpu_to_node(destid)), irq);
 }
 
-void __init plat_prepare_cpus(unsigned int max_cpus)
+static void ip27_send_ipi_mask(cpumask_t mask, unsigned int action)
+{
+       unsigned int i;
+
+       for_each_cpu_mask(i, mask)
+               ip27_send_ipi_single(i, action);
+}
+
+static void __cpuinit ip27_init_secondary(void)
+{
+       per_cpu_init();
+       local_irq_enable();
+}
+
+static void __cpuinit ip27_smp_finish(void)
+{
+}
+
+static void __init ip27_cpus_done(void)
 {
-       /* We already did everything necessary earlier */
 }
 
 /*
@@ -171,51 +192,49 @@ void __init plat_prepare_cpus(unsigned int max_cpus)
  * set sp to the kernel stack of the newly created idle process, gp to the proc
  * struct so that current_thread_info() will work.
  */
-void __init prom_boot_secondary(int cpu, struct task_struct *idle)
+static void __cpuinit ip27_boot_secondary(int cpu, struct task_struct *idle)
 {
        unsigned long gp = (unsigned long)task_thread_info(idle);
        unsigned long sp = __KSTK_TOS(idle);
 
-       LAUNCH_SLAVE(cputonasid(cpu),cputoslice(cpu),
+       LAUNCH_SLAVE(cputonasid(cpu), cputoslice(cpu),
                (launch_proc_t)MAPPED_KERN_RW_TO_K0(smp_bootstrap),
                0, (void *) sp, (void *) gp);
 }
 
-void __cpuinit prom_init_secondary(void)
+static void __init ip27_smp_setup(void)
 {
-       per_cpu_init();
-       local_irq_enable();
-}
-
-void __init prom_cpus_done(void)
-{
-}
-
-void prom_smp_finish(void)
-{
-}
-
-void core_send_ipi(int destid, unsigned int action)
-{
-       int irq;
+       cnodeid_t       cnode;
 
-       switch (action) {
-       case SMP_RESCHEDULE_YOURSELF:
-               irq = CPU_RESCHED_A_IRQ;
-               break;
-       case SMP_CALL_FUNCTION:
-               irq = CPU_CALL_A_IRQ;
-               break;
-       default:
-               panic("sendintr");
+       for_each_online_node(cnode) {
+               if (cnode == 0)
+                       continue;
+               intr_clear_all(COMPACT_TO_NASID_NODEID(cnode));
        }
 
-       irq += cputoslice(destid);
+       replicate_kernel_text();
 
        /*
-        * Convert the compact hub number to the NASID to get the correct
-        * part of the address space.  Then set the interrupt bit associated
-        * with the CPU we want to send the interrupt to.
+        * Assumption to be fixed: we're always booted on logical / physical
+        * processor 0.  While we're always running on logical processor 0
+        * this still means this is physical processor zero; it might for
+        * example be disabled in the firwware.
         */
-       REMOTE_HUB_SEND_INTR(COMPACT_TO_NASID_NODEID(cpu_to_node(destid)), irq);
+       alloc_cpupda(0, 0);
 }
+
+static void __init ip27_prepare_cpus(unsigned int max_cpus)
+{
+       /* We already did everything necessary earlier */
+}
+
+struct plat_smp_ops ip27_smp_ops = {
+       .send_ipi_single        = ip27_send_ipi_single,
+       .send_ipi_mask          = ip27_send_ipi_mask,
+       .init_secondary         = ip27_init_secondary,
+       .smp_finish             = ip27_smp_finish,
+       .cpus_done              = ip27_cpus_done,
+       .boot_secondary         = ip27_boot_secondary,
+       .smp_setup              = ip27_smp_setup,
+       .prepare_cpus           = ip27_prepare_cpus,
+};