diff options
Diffstat (limited to 'src/kernel/assert.c')
-rw-r--r-- | src/kernel/assert.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/kernel/assert.c b/src/kernel/assert.c new file mode 100644 index 0000000..9bd1107 --- /dev/null +++ b/src/kernel/assert.c @@ -0,0 +1,9 @@ +#include <assert.h> +#include <kernel/arch/generic.h> + +_Noreturn void __badassert(const char *func, const char *file, int line) { + /* same format as panics */ + kprintf("\nan assert PANIC! at the %s (%s:%u)\n", func, file, line); + debug_stacktrace(); + cpu_halt(); +} |