22 lines
336 B
C
22 lines
336 B
C
#include "../common.h"
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include "../uart.h"
|
|
|
|
void panic(const char *format, ...) {
|
|
uart_puts("Kernel panic!");
|
|
uart_puts("Reason:");
|
|
|
|
va_list args = nullptr;
|
|
va_start(args, format);
|
|
|
|
// Print the reason
|
|
uart_vprintf(format, args);
|
|
|
|
va_end(args);
|
|
|
|
// Hang
|
|
asm volatile("wfi");
|
|
}
|