From 809f9a9899b219e33ec839b3f9bee644fcfecacc Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 6 Aug 2022 23:53:42 +0200 Subject: shared assert.h --- src/kernel/assert.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/kernel/assert.c (limited to 'src/kernel/assert.c') 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 +#include + +_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(); +} -- cgit v1.2.3