]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ppc64/kernel/pmac_smp.c
ppc64: Simplify secondary CPU startup on powermacs
[linux-2.6-omap-h63xx.git] / arch / ppc64 / kernel / pmac_smp.c
index a23de37227bfcc9b81edc2839a6f817f58e61171..83c2f8dc1ec6b16267b818ca677cd1ecffe386a2 100644 (file)
@@ -51,8 +51,7 @@
 #include <asm/cacheflush.h>
 #include <asm/keylargo.h>
 #include <asm/pmac_low_i2c.h>
-
-#include "mpic.h"
+#include <asm/mpic.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
@@ -60,9 +59,7 @@
 #define DBG(fmt...)
 #endif
 
-extern void pmac_secondary_start_1(void);
-extern void pmac_secondary_start_2(void);
-extern void pmac_secondary_start_3(void);
+extern void __secondary_start_pmac_0(void);
 
 extern struct smp_ops_t *smp_ops;
 
@@ -237,7 +234,7 @@ static int __init smp_core99_probe(void)
 
 static void __init smp_core99_kick_cpu(int nr)
 {
-       int save_vector, j;
+       unsigned int save_vector, j;
        unsigned long new_vector;
        unsigned long flags;
        volatile unsigned int *vector
@@ -254,20 +251,9 @@ static void __init smp_core99_kick_cpu(int nr)
        save_vector = *vector;
 
        /* Setup fake reset vector that does    
-        *   b .pmac_secondary_start - KERNELBASE
+        *   b __secondary_start_pmac_0 + nr*8 - KERNELBASE
         */
-       switch(nr) {
-       case 1:
-               new_vector = (unsigned long)pmac_secondary_start_1;
-               break;
-       case 2:
-               new_vector = (unsigned long)pmac_secondary_start_2;
-               break;                  
-       case 3:
-       default:
-               new_vector = (unsigned long)pmac_secondary_start_3;
-               break;
-       }
+       new_vector = (unsigned long) __secondary_start_pmac_0 + nr * 8;
        *vector = 0x48000002 + (new_vector - KERNELBASE);
 
        /* flush data cache and inval instruction cache */
@@ -310,7 +296,7 @@ static void __init smp_core99_setup_cpu(int cpu_nr)
        }
 }
 
-struct smp_ops_t core99_smp_ops __pmacdata = {
+struct smp_ops_t core99_smp_ops = {
        .message_pass   = smp_mpic_message_pass,
        .probe          = smp_core99_probe,
        .kick_cpu       = smp_core99_kick_cpu,