Update akaros to hook in the new topology stuff
[akaros.git] / user / parlib / thread0_sched.c
index 587b1e6..926d6e8 100644 (file)
 
 static void thread0_sched_entry(void);
 static void thread0_thread_blockon_sysc(struct uthread *uthread, void *sysc);
+static void thread0_thread_refl_fault(struct uthread *uthread,
+                                      unsigned int trap_nr, unsigned int err,
+                                      unsigned long aux);
 
 /* externed into uthread.c */
 struct schedule_ops thread0_2ls_ops = {
        .sched_entry = thread0_sched_entry,
        .thread_blockon_sysc = thread0_thread_blockon_sysc,
+       .thread_refl_fault = thread0_thread_refl_fault,
 };
 
 /* externed into uthread.c */
@@ -64,3 +68,14 @@ static void thread0_thread_blockon_sysc(struct uthread *uthread, void *arg)
                __ros_syscall_noerrno(SYS_yield, FALSE, 0, 0, 0, 0, 0);
        }
 }
+
+static void thread0_thread_refl_fault(struct uthread *uthread,
+                                      unsigned int trap_nr, unsigned int err,
+                                      unsigned long aux)
+{
+       printf("SCP has unhandled fault: %d, err: %d, aux: %p\n", trap_nr, err,
+              aux);
+       print_user_context(&uthread->u_ctx);
+       printf("Turn on printx to spew unhandled, malignant trap info\n");
+       exit(-1);
+}