2019-05-31 08:41:28 +02:00
|
|
|
const builtin = @import("builtin");
|
|
|
|
const tty = @import("tty.zig");
|
2019-09-08 21:48:23 +02:00
|
|
|
const arch = @import("arch.zig").internals;
|
2019-09-29 13:55:34 +02:00
|
|
|
const log = @import("log.zig");
|
2019-05-31 08:41:28 +02:00
|
|
|
|
2019-09-29 13:55:34 +02:00
|
|
|
pub fn panic(trace: ?*builtin.StackTrace, comptime format: []const u8, args: ...) noreturn {
|
2019-05-31 08:41:28 +02:00
|
|
|
@setCold(true);
|
2019-10-01 12:52:23 +02:00
|
|
|
arch.disableInterrupts();
|
2019-09-29 13:55:34 +02:00
|
|
|
log.logInfo("KERNEL PANIC\n");
|
|
|
|
log.logInfo(format, args);
|
|
|
|
log.logInfo("HALTING\n");
|
2019-05-31 08:41:28 +02:00
|
|
|
arch.haltNoInterrupts();
|
|
|
|
}
|