Kernel: Lock debug lock while printing fault details

This allows multiprocessor to dump clean output on concurrent faults
This commit is contained in:
Bananymous 2024-05-29 15:49:24 +03:00
parent 4bf7a08c80
commit 99270e96a9
1 changed files with 4 additions and 0 deletions

View File

@ -245,6 +245,8 @@ namespace Kernel
#endif
}
Debug::s_debug_lock.lock();
if (PageTable::current().get_page_flags(interrupt_stack->ip & PAGE_ADDR_MASK) & PageTable::Flags::Present)
{
auto* machine_code = (const uint8_t*)interrupt_stack->ip;
@ -293,6 +295,8 @@ namespace Kernel
PageTable::current().debug_dump();
Debug::dump_stack_trace();
Debug::s_debug_lock.unlock(InterruptState::Disabled);
if (tid && Thread::current().is_userspace())
{
// TODO: Confirm and fix the exception to signal mappings