mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 18:23:39 +00:00
Tidy up the page fault code a bit in preparation.
This commit is contained in:
parent
72cdc62155
commit
e85c22fe58
Notes:
sideshowbarker
2024-07-19 18:33:41 +09:00
Author: https://github.com/awesomekling
Commit: e85c22fe58
4 changed files with 19 additions and 18 deletions
|
@ -105,7 +105,8 @@ void MemoryManager::deallocate_page_table(PageDirectory& page_directory, unsigne
|
|||
{
|
||||
auto& physical_page = page_directory.physical_pages[index];
|
||||
ASSERT(physical_page);
|
||||
ASSERT(!m_free_physical_pages.contains_slow(physical_page));
|
||||
//FIXME: This line is buggy and effectful somehow :(
|
||||
//ASSERT(!m_free_physical_pages.contains_slow(physical_page));
|
||||
for (size_t i = 0; i < MM.m_free_physical_pages.size(); ++i) {
|
||||
ASSERT(MM.m_free_physical_pages[i].ptr() != physical_page.ptr());
|
||||
}
|
||||
|
@ -207,13 +208,13 @@ void MemoryManager::initialize()
|
|||
s_the = new MemoryManager;
|
||||
}
|
||||
|
||||
PageFaultResponse MemoryManager::handlePageFault(const PageFault& fault)
|
||||
PageFaultResponse MemoryManager::handle_page_fault(const PageFault& fault)
|
||||
{
|
||||
ASSERT_INTERRUPTS_DISABLED();
|
||||
kprintf("MM: handlePageFault(%w) at L%x\n", fault.code(), fault.address().get());
|
||||
if (fault.isNotPresent()) {
|
||||
kprintf("MM: handle_page_fault(%w) at L%x\n", fault.code(), fault.laddr().get());
|
||||
if (fault.is_not_present()) {
|
||||
kprintf(" >> NP fault!\n");
|
||||
} else if (fault.isProtectionViolation()) {
|
||||
} else if (fault.is_protection_violation()) {
|
||||
kprintf(" >> PV fault!\n");
|
||||
}
|
||||
return PageFaultResponse::ShouldCrash;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue