add support to GIC ITS, and the MSI service base on it
[lunaix-os.git] / lunaix-os / kernel / spike.c
1 #include <klibc/strfmt.h>
2 #include <lunaix/spike.h>
3 #include <lunaix/hart_state.h>
4 #include <lunaix/syslog.h>
5 #include <lunaix/trace.h>
6 #include <lunaix/failsafe.h>
7
8 #include <asm/cpu.h>
9
10 LOG_MODULE("spike")
11
12 void noret
13 __assert_fail(const char* expr, const char* file, unsigned int line)
14 {
15     // Don't do another trap, print it right-away, allow
16     //  the stack context being preserved
17     cpu_disable_interrupt();
18     ERROR("assertion fail (%s:%u)\n\t%s", file, line, expr);
19     
20     failsafe_diagnostic();
21 }