Kernel messages infrastructure
[akaros.git] / kern / arch / sparc / smp.c
index 631396f..8b7f949 100644 (file)
@@ -94,13 +94,13 @@ int smp_call_function_all(isr_t handler, void* data,
                if(i == core_id())
                        continue;
 
-               send_active_message(i,(amr_t)smp_call_wrapper,
-                                         handler, wrapper, data);
+               send_kernel_message(i,(amr_t)smp_call_wrapper,
+                                         handler, wrapper, data, AMSG_IMMEDIATE);
        }
 
        // send to me
-       send_active_message(core_id(),(amr_t)smp_call_wrapper,
-                                 handler,wrapper,data);
+       send_kernel_message(core_id(),(amr_t)smp_call_wrapper,
+                                 handler,wrapper,data, AMSG_IMMEDIATE);
 
        cpu_relax(); // wait to get the interrupt
 
@@ -124,8 +124,8 @@ int smp_call_function_single(uint32_t dest, isr_t handler, void* data,
 
        enable_irqsave(&state);
 
-       send_active_message(dest,(amr_t)smp_call_wrapper,
-                                 handler,wrapper,data);
+       send_kernel_message(dest,(amr_t)smp_call_wrapper,
+                                 handler,wrapper,data, AMSG_IMMEDIATE);
 
        cpu_relax(); // wait to get the interrupt, if it's to this core
 
@@ -150,5 +150,8 @@ int smp_call_wait(handler_wrapper_t* wrapper)
 void smp_percpu_init(void)
 {
        uint32_t coreid = core_id();
-       STAILQ_INIT(&per_cpu_info[coreid].active_msgs);
+       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);
 }