diff options
author | dzwdz | 2021-09-20 20:32:58 +0200 |
---|---|---|
committer | dzwdz | 2021-09-20 20:32:58 +0200 |
commit | d192b15ee05b6d79c1503eb296fcab693a05dced (patch) | |
tree | 2030e86317f954f67a4e3c4fc0c61798d5555ab2 /src/kernel/panic.h | |
parent | 6371724809b057b25a4efd6c022e7d95068c42f1 (diff) |
create a few specialized panic()s
thanks to this i can tell which ones are placeholders, and which ones
should stay
Diffstat (limited to 'src/kernel/panic.h')
-rw-r--r-- | src/kernel/panic.h | 10 |
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 |