mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:57:35 +00:00
Kernel: Implement __panic() for the aarch64 Kernel
Now that dump_backtrace() works, we can actually print a helpful backtrace when the Kernel panics.
This commit is contained in:
parent
e7cf591ec0
commit
e81e1fa9c8
4 changed files with 26 additions and 10 deletions
|
@ -24,16 +24,6 @@ READONLY_AFTER_INIT Thread* g_finalizer;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Panic
|
|
||||||
namespace Kernel {
|
|
||||||
|
|
||||||
void __panic(char const*, unsigned int, char const*)
|
|
||||||
{
|
|
||||||
for (;;) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Random
|
// Random
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
|
|
23
Kernel/Arch/aarch64/Panic.cpp
Normal file
23
Kernel/Arch/aarch64/Panic.cpp
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Kernel/Arch/Processor.h>
|
||||||
|
#include <Kernel/KSyms.h>
|
||||||
|
#include <Kernel/Panic.h>
|
||||||
|
|
||||||
|
// FIXME: Merge the code in this file with Kernel/Panic.cpp once the proper abstractions are in place.
|
||||||
|
|
||||||
|
namespace Kernel {
|
||||||
|
|
||||||
|
void __panic(char const* file, unsigned int line, char const* function)
|
||||||
|
{
|
||||||
|
critical_dmesgln("at {}:{} in {}", file, line, function);
|
||||||
|
dump_backtrace(PrintToScreen::Yes);
|
||||||
|
|
||||||
|
Processor::halt();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -418,6 +418,7 @@ else()
|
||||||
Arch/aarch64/kprintf.cpp
|
Arch/aarch64/kprintf.cpp
|
||||||
Arch/aarch64/MainIdRegister.cpp
|
Arch/aarch64/MainIdRegister.cpp
|
||||||
Arch/aarch64/PageDirectory.cpp
|
Arch/aarch64/PageDirectory.cpp
|
||||||
|
Arch/aarch64/Panic.cpp
|
||||||
Arch/aarch64/SafeMem.cpp
|
Arch/aarch64/SafeMem.cpp
|
||||||
Arch/aarch64/ScopedCritical.cpp
|
Arch/aarch64/ScopedCritical.cpp
|
||||||
Arch/aarch64/SmapDisabler.cpp
|
Arch/aarch64/SmapDisabler.cpp
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/Format.h>
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
[[noreturn]] void __panic(char const* file, unsigned int line, char const* function);
|
[[noreturn]] void __panic(char const* file, unsigned int line, char const* function);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue