Arch independent per-cpu initialization
[akaros.git] / kern / arch / sparc / smp.c
index 33d1764..b00ac84 100644 (file)
@@ -35,6 +35,7 @@ smp_init(void)
 {
        static spinlock_t report_in_lock = SPINLOCK_INITIALIZER;
 
+       smp_percpu_init();
        spin_lock(&report_in_lock);
        num_cpus++;
        spin_unlock(&report_in_lock);
@@ -149,11 +150,6 @@ int smp_call_wait(handler_wrapper_t* wrapper)
 /* Perform any initialization needed by per_cpu_info.  Right now, this just
  * inits the amsg list (which sparc will probably also want).  Make sure every
  * core calls this at some point in the smp_boot process. */
-void smp_percpu_init(void)
+void __arch_pcpu_init(uint32_t coreid)
 {
-       uint32_t coreid = core_id();
-       spinlock_init(&per_cpu_info[coreid].immed_amsg_lock);
-       STAILQ_INIT(&per_cpu_info[coreid].immed_amsgs);
-       spinlock_init(&per_cpu_info[coreid].routine_amsg_lock);
-       STAILQ_INIT(&per_cpu_info[coreid].routine_amsgs);
 }