2022-11-14 18:53:00 +02:00
|
|
|
#pragma once
|
|
|
|
|
2022-11-16 19:47:19 +02:00
|
|
|
#include <kernel/kprint.h>
|
|
|
|
|
2022-11-14 18:53:00 +02:00
|
|
|
namespace Kernel
|
|
|
|
{
|
|
|
|
|
2022-11-16 19:47:19 +02:00
|
|
|
template<typename... Args>
|
2022-11-14 18:53:00 +02:00
|
|
|
__attribute__((__noreturn__))
|
2022-11-16 19:47:19 +02:00
|
|
|
static void panic(const char* message, Args... args)
|
|
|
|
{
|
2022-12-13 00:57:13 +02:00
|
|
|
kprint("\e[31mKernel panic: ");
|
2022-11-16 19:47:19 +02:00
|
|
|
kprint(message, args...);
|
2022-12-13 00:57:13 +02:00
|
|
|
kprint("\e[m\n");
|
2022-12-03 18:19:07 +02:00
|
|
|
asm volatile("cli; hlt");
|
2022-11-16 19:47:19 +02:00
|
|
|
__builtin_unreachable();
|
|
|
|
}
|
2022-11-14 18:53:00 +02:00
|
|
|
|
|
|
|
}
|