diff options
Diffstat (limited to 'kernel/panic.c')
-rw-r--r-- | kernel/panic.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/kernel/panic.c b/kernel/panic.c deleted file mode 100644 index 65279f0..0000000 --- a/kernel/panic.c +++ /dev/null @@ -1,26 +0,0 @@ -#include <kernel/panic.h> -#include <libk/io.h> -#include <stdint.h> -#include <stddef.h> - -static int panicked = 0; - -void walk_stack(uintptr_t *addrs, size_t n); - -void stack_trace(void) { - kprintf("PRINTING STACK TRACE\n"); - uintptr_t strace[32]; - walk_stack(strace, 32); - for (int i = 0; i < 32; i++) { - if (strace[i] == 0) - break; - kprintf("#%d: %x\n", i, strace[i]); - } -} - -void panic(const char *str) { - panicked = 1; - kprintf("KERNEL PANIC: %s\n", str); - stack_trace(); - while (1); -} |