Add support for attempting returns from panic
[akaros.git] / kern / src / trap.c
index 83d4a58..5e3824d 100644 (file)
@@ -59,6 +59,7 @@ int reflect_current_context(void)
        uint32_t vcoreid = pcpui->owning_vcoreid;
        struct preempt_data *vcpd = &p->procdata->vcore_preempt_data[vcoreid];
 
+       assert(pcpui->cur_proc == pcpui->owning_proc);
        if (!proc_is_vcctx_ready(p))
                return -1;
        if (vcpd->notif_disabled)
@@ -110,7 +111,8 @@ struct kmem_cache *kernel_msg_cache;
 void kernel_msg_init(void)
 {
        kernel_msg_cache = kmem_cache_create("kernel_msgs",
-                          sizeof(struct kernel_message), ARCH_CL_SIZE, 0, 0, 0);
+                                            sizeof(struct kernel_message),
+                                            ARCH_CL_SIZE, 0, NULL, 0, 0, NULL);
 }
 
 uint32_t send_kernel_message(uint32_t dst, amr_t pc, long arg0, long arg1,
@@ -265,8 +267,9 @@ void print_kmsgs(uint32_t coreid)
                struct kernel_message *kmsg_i;
                STAILQ_FOREACH(kmsg_i, list, link) {
                        fn_name = get_fn_name((long)kmsg_i->pc);
-                       printk("%s KMSG on %d from %d to run %p(%s)\n", type,
-                              kmsg_i->dstid, kmsg_i->srcid, kmsg_i->pc, fn_name);
+                       printk("%s KMSG on %d from %d to run %p(%s)(%p, %p, %p)\n", type,
+                              kmsg_i->dstid, kmsg_i->srcid, kmsg_i->pc, fn_name,
+                              kmsg_i->arg0, kmsg_i->arg1, kmsg_i->arg2);
                        kfree(fn_name);
                }
        }