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