Kernel: Release debug lock if its locked during kernel panic
Also kernel panic now prints if it had lock
This commit is contained in:
parent
f7e549e412
commit
999eb53364
|
@ -17,7 +17,11 @@ namespace Kernel
|
||||||
static void panic_impl(const char* location, const char* message, Args&&... args)
|
static void panic_impl(const char* location, const char* message, Args&&... args)
|
||||||
{
|
{
|
||||||
asm volatile("cli");
|
asm volatile("cli");
|
||||||
|
|
||||||
|
const bool had_debug_lock = Debug::s_debug_lock.current_processor_has_lock();
|
||||||
derrorln("Kernel panic at {}", location);
|
derrorln("Kernel panic at {}", location);
|
||||||
|
if (had_debug_lock)
|
||||||
|
derrorln(" while having debug lock...");
|
||||||
derrorln(message, BAN::forward<Args>(args)...);
|
derrorln(message, BAN::forward<Args>(args)...);
|
||||||
if (!g_paniced)
|
if (!g_paniced)
|
||||||
{
|
{
|
||||||
|
|
|
@ -360,6 +360,8 @@ done:
|
||||||
{
|
{
|
||||||
if (g_paniced)
|
if (g_paniced)
|
||||||
{
|
{
|
||||||
|
while (Debug::s_debug_lock.current_processor_has_lock())
|
||||||
|
Debug::s_debug_lock.unlock(InterruptState::Disabled);
|
||||||
dprintln("Processor {} halted", Processor::current_id());
|
dprintln("Processor {} halted", Processor::current_id());
|
||||||
if (InterruptController::is_initialized())
|
if (InterruptController::is_initialized())
|
||||||
InterruptController::get().broadcast_ipi();
|
InterruptController::get().broadcast_ipi();
|
||||||
|
|
Loading…
Reference in New Issue