* Remove the debugging hack in procvm.c
[lunaix-os.git] / lunaix-os / kernel / spike.c
1 #include <klibc/strfmt.h>
2 #include <lunaix/spike.h>
3 #include <lunaix/pcontext.h>
4 #include <lunaix/syslog.h>
5 #include <lunaix/trace.h>
6
7 LOG_MODULE("spike")
8
9 void noret
10 __assert_fail(const char* expr, const char* file, unsigned int line)
11 {
12     // Don't do another trap, print it right-away, allow
13     //  the stack context being preserved
14     cpu_disable_interrupt();
15     ERROR("assertion fail (%s:%u)\n\t%s", file, line, expr);
16     trace_printstack();
17
18     spin(); // never reach
19 }
20
21 void noret
22 panick(const char* msg)
23 {
24     cpu_trap_panic(msg);
25     spin();
26 }