summaryrefslogtreecommitdiff
path: root/src/kernel/assert.c
diff options
context:
space:
mode:
authordzwdz2022-08-06 23:53:42 +0200
committerdzwdz2022-08-06 23:53:42 +0200
commit809f9a9899b219e33ec839b3f9bee644fcfecacc (patch)
tree5a4f4149859d5e834b5fe73b52a5e95e7e2d749b /src/kernel/assert.c
parente86d720f6481e83ff555989006b7f62433318f57 (diff)
shared assert.h
Diffstat (limited to 'src/kernel/assert.c')
-rw-r--r--src/kernel/assert.c9
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();
+}