mmu_map_physical_memory() now accepts physical memory addresses that are not aligned to a page.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8014 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
1273cbedfc
commit
842a265376
@ -238,12 +238,15 @@ extern "C" addr_t
|
|||||||
mmu_map_physical_memory(addr_t physicalAddress, size_t size, uint32 flags)
|
mmu_map_physical_memory(addr_t physicalAddress, size_t size, uint32 flags)
|
||||||
{
|
{
|
||||||
addr_t address = sNextVirtualAddress;
|
addr_t address = sNextVirtualAddress;
|
||||||
|
addr_t pageOffset = physicalAddress & (B_PAGE_SIZE - 1);
|
||||||
|
|
||||||
|
physicalAddress -= pageOffset;
|
||||||
|
|
||||||
for (addr_t offset = 0; offset < size; offset += B_PAGE_SIZE) {
|
for (addr_t offset = 0; offset < size; offset += B_PAGE_SIZE) {
|
||||||
map_page(get_next_virtual_page(), physicalAddress + offset, flags);
|
map_page(get_next_virtual_page(), physicalAddress + offset, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return address;
|
return address + pageOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user