mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Kernel: Add MemoryManager::copy_physical_page()
This is a handy helper that copies out the full contents of a physical page into a caller-provided buffer. It uses quickmapping internally (and takes the MM lock for the duration.)
This commit is contained in:
@@ -1118,4 +1118,12 @@ void CommittedPhysicalPageSet::uncommit_one()
|
||||
MM.uncommit_user_physical_pages({}, 1);
|
||||
}
|
||||
|
||||
void MemoryManager::copy_physical_page(PhysicalPage& physical_page, u8 page_buffer[PAGE_SIZE])
|
||||
{
|
||||
SpinlockLocker locker(s_mm_lock);
|
||||
auto* quickmapped_page = quickmap_page(physical_page);
|
||||
memcpy(page_buffer, quickmapped_page, PAGE_SIZE);
|
||||
unquickmap_page();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user