mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:07:45 +00:00
Kernel: Move __assertion_failed to aarch64/Panic.cpp
This is for an upcoming change to add the Kernel namespace to the init.cpp file.
This commit is contained in:
parent
d451bdec6f
commit
9282e0db16
2 changed files with 13 additions and 15 deletions
|
@ -10,14 +10,23 @@
|
||||||
|
|
||||||
// FIXME: Merge the code in this file with Kernel/Panic.cpp once the proper abstractions are in place.
|
// FIXME: Merge the code in this file with Kernel/Panic.cpp once the proper abstractions are in place.
|
||||||
|
|
||||||
namespace Kernel {
|
// Note: This is required here, since __assertion_failed should be out of the Kernel namespace,
|
||||||
|
// but the PANIC macro uses functions that require the Kernel namespace.
|
||||||
|
using namespace Kernel;
|
||||||
|
|
||||||
void __panic(char const* file, unsigned int line, char const* function)
|
[[noreturn]] void __assertion_failed(char const* msg, char const* file, unsigned line, char const* func)
|
||||||
|
{
|
||||||
|
critical_dmesgln("ASSERTION FAILED: {}", msg);
|
||||||
|
critical_dmesgln("{}:{} in {}", file, line, func);
|
||||||
|
|
||||||
|
// Used for printing a nice backtrace!
|
||||||
|
PANIC("Aborted");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kernel::__panic(char const* file, unsigned int line, char const* function)
|
||||||
{
|
{
|
||||||
critical_dmesgln("at {}:{} in {}", file, line, function);
|
critical_dmesgln("at {}:{} in {}", file, line, function);
|
||||||
dump_backtrace(PrintToScreen::Yes);
|
dump_backtrace(PrintToScreen::Yes);
|
||||||
|
|
||||||
Processor::halt();
|
Processor::halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -103,17 +103,6 @@ void __stack_chk_fail()
|
||||||
Kernel::Processor::halt();
|
Kernel::Processor::halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace Kernel;
|
|
||||||
|
|
||||||
[[noreturn]] void __assertion_failed(char const* msg, char const* file, unsigned line, char const* func)
|
|
||||||
{
|
|
||||||
critical_dmesgln("ASSERTION FAILED: {}", msg);
|
|
||||||
critical_dmesgln("{}:{} in {}", file, line, func);
|
|
||||||
|
|
||||||
// Used for printing a nice backtrace!
|
|
||||||
PANIC("Aborted");
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" void exception_common(TrapFrame const* const trap_frame)
|
extern "C" void exception_common(TrapFrame const* const trap_frame)
|
||||||
{
|
{
|
||||||
constexpr bool print_stack_frame = true;
|
constexpr bool print_stack_frame = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue