summaryrefslogtreecommitdiff
path: root/src/kernel/panic.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/panic.h')
-rw-r--r--src/kernel/panic.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/kernel/panic.h b/src/kernel/panic.h
index 9407e44..b62c630 100644
--- a/src/kernel/panic.h
+++ b/src/kernel/panic.h
@@ -2,11 +2,15 @@
#include <kernel/arch/generic.h>
#include <kernel/util.h>
-#define panic() do { \
- tty_const(" PANIC! at the "); \
+#define _panic(type) do { \
+ tty_const(" an "type" PANIC! at the "); \
tty_const(__func__); \
tty_const(" (" __FILE__ ":" NUM2STR(__LINE__) ") "); \
halt_cpu(); \
} while (0)
-#define assert(stmt) do { if (!(stmt)) panic(); } while (0)
+#define panic_invalid_state() _panic("invalid state")
+#define panic_unimplemented() _panic("unimplemented")
+#define assert(stmt) do { if (!(stmt)) _panic(); } while (0)
+
+#undef panic