From 9b63c0000b2e0d9d0a306e56dbc7bc28403e5549 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Thu, 17 Feb 2022 13:40:55 +0000 Subject: many changes have happned - updates to panic() interface - genericized timer interface - (yet unused) additions to task management --- kc/core/panic.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'kc/core/panic.c') diff --git a/kc/core/panic.c b/kc/core/panic.c index 6fd5581..2f46a6a 100644 --- a/kc/core/panic.c +++ b/kc/core/panic.c @@ -6,17 +6,22 @@ static char const *reason_strings[] = { "general panic", "unhandled fault", - "out of memory" + "out of memory", + "dead-end routine" }; -noreturn void panic(enum panic_reason reason) +noreturn void panic(const char *file, int line, enum panic_reason reason) { // TODO: kprintf() and friends if (reason > sizeof(reason_strings) / sizeof(*reason_strings)) { reason = 0; } - kprintf("kernel panic: %s\n", reason_strings[reason]); + kprintf( + "kernel panic:%s:%u %s\n", + file, + line, + reason_strings[reason]); halt(); } @@ -25,3 +30,4 @@ noreturn void halt(void) __asm__ ("cli\n\t"); while (true) __asm__ ("hlt\n\t"); } + -- cgit v1.3.1-1-g115d