kernel/arm: ensure page dir is correctly aligned
Page directory physical address must be aligned on 16K and it must be mapped to a contiguous physical region. Change-Id: I6723023c9deaa1c4a1081cf5a984a1766241a532 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5423 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
0db74b55dc
commit
fe3405c087
@@ -100,10 +100,22 @@ ARMVMTranslationMap32Bit::Init(bool kernel)
|
||||
return error;
|
||||
|
||||
// allocate the page directory
|
||||
page_directory_entry* virtualPageDir = (page_directory_entry*)memalign(
|
||||
PAGEDIR_ALIGN, PAGEDIR_SIZE);
|
||||
if (virtualPageDir == NULL)
|
||||
page_directory_entry *virtualPageDir = NULL;
|
||||
|
||||
virtual_address_restrictions virtualRestrictions = {};
|
||||
virtualRestrictions.address_specification = B_ANY_KERNEL_ADDRESS;
|
||||
|
||||
physical_address_restrictions physicalRestrictions = {};
|
||||
physicalRestrictions.alignment = PAGEDIR_ALIGN;
|
||||
|
||||
area_id pgdir_area = create_area_etc(B_SYSTEM_TEAM, "pgdir",
|
||||
PAGEDIR_SIZE, B_CONTIGUOUS,
|
||||
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, 0,
|
||||
&virtualRestrictions, &physicalRestrictions, (void **)&virtualPageDir);
|
||||
|
||||
if (pgdir_area < 0) {
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
|
||||
// look up the page directory's physical address
|
||||
phys_addr_t physicalPageDir;
|
||||
|
||||
Reference in New Issue
Block a user