mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
Kernel: Move create_identity_mapped_region() to MemoryManager
This had no business being in RegionTree, since RegionTree doesn't track identity-mapped regions anyway. (We allow *any* address to be identity mapped, not just the ones that are part of the RegionTree's range.)
This commit is contained in:
parent
3dbb4bc3a6
commit
e0da8da657
5 changed files with 12 additions and 13 deletions
|
@ -1232,4 +1232,14 @@ void MemoryManager::copy_physical_page(PhysicalPage& physical_page, u8 page_buff
|
|||
unquickmap_page();
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<Memory::Region>> MemoryManager::create_identity_mapped_region(PhysicalAddress address, size_t size)
|
||||
{
|
||||
auto vmobject = TRY(Memory::AnonymousVMObject::try_create_for_physical_range(address, size));
|
||||
auto region = TRY(Memory::Region::create_unplaced(move(vmobject), 0, {}, Memory::Region::Access::ReadWriteExecute));
|
||||
Memory::VirtualRange range { VirtualAddress { (FlatPtr)address.get() }, size };
|
||||
region->m_range = range;
|
||||
TRY(region->map(MM.kernel_page_directory()));
|
||||
return region;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue