1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:07:46 +00:00

Kernel: Simplify a bunch of dbg() and klog() calls

LogStream can handle VirtualAddress and PhysicalAddress directly.
This commit is contained in:
Andreas Kling 2020-03-06 15:00:44 +01:00
parent b866582d98
commit c6693f9b3a
11 changed files with 32 additions and 33 deletions

View file

@ -252,7 +252,7 @@ void Region::unmap(ShouldDeallocateVirtualMemoryRange deallocate_range)
MM.flush_tlb(vaddr);
#ifdef MM_DEBUG
auto& physical_page = vmobject().physical_pages()[first_page_index() + i];
dbg() << "MM: >> Unmapped V" << String::format("%p", vaddr.get()) << " => P" << String::format("%p", physical_page ? physical_page->paddr().get() : 0) << " <<";
dbg() << "MM: >> Unmapped " << vaddr << " => P" << String::format("%p", physical_page ? physical_page->paddr().get() : 0) << " <<";
#endif
}
if (deallocate_range == ShouldDeallocateVirtualMemoryRange::Yes)
@ -358,8 +358,7 @@ PageFaultResponse Region::handle_zero_fault(size_t page_index_in_region)
}
#ifdef PAGE_FAULT_DEBUG
dbg() << " >> ZERO P\n"
<< String::format("%p", physical_page->paddr().get());
dbg() << " >> ZERO " << physical_page->paddr();
#endif
vmobject_physical_page_entry = move(physical_page);
remap_page(page_index_in_region);
@ -394,7 +393,7 @@ PageFaultResponse Region::handle_cow_fault(size_t page_index_in_region)
u8* dest_ptr = MM.quickmap_page(*physical_page);
const u8* src_ptr = vaddr().offset(page_index_in_region * PAGE_SIZE).as_ptr();
#ifdef PAGE_FAULT_DEBUG
dbg() << " >> COW P" << String::format("%p", physical_page->paddr().get()) << " <- P" << String::format("%p", physical_page_to_copy->paddr().get());
dbg() << " >> COW " << physical_page->paddr() << " <- " << physical_page_to_copy->paddr();
#endif
copy_from_user(dest_ptr, src_ptr, PAGE_SIZE);
vmobject_physical_page_entry = move(physical_page);