diff options
Diffstat (limited to 'lib/kpanic.c')
-rw-r--r-- | lib/kpanic.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/kpanic.c b/lib/kpanic.c new file mode 100644 index 0000000..97e42eb --- /dev/null +++ b/lib/kpanic.c @@ -0,0 +1,15 @@ +#include "jove.h" +#include "io/log.h" + +#include <stdarg.h> + +__attribute__((noreturn)) +void _kpanic(const char *file, int line, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + klogf("!!! PANIC !!!\n%s:%i\n", file, line); + kvlogf(fmt, ap); + va_end(ap); + for(;;) __asm__ volatile("hlt"); +} |