From b594d76c81522870f97c5bb7ec6f48e3d6374ab7 Mon Sep 17 00:00:00 2001 From: David Karoly Date: Sun, 24 Oct 2021 10:57:12 +0200 Subject: [PATCH] boot/efi: use ROUNDUP for aligning the page directory Change-Id: Ib52ca83cbc390f2e450c174741ed24e745fb7eab Reviewed-on: https://review.haiku-os.org/c/haiku/+/4655 Reviewed-by: Adrien Destugues --- src/system/boot/platform/efi/arch/arm/arch_mmu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/boot/platform/efi/arch/arm/arch_mmu.cpp b/src/system/boot/platform/efi/arch/arm/arch_mmu.cpp index c9963a8a84..d549e43dcb 100644 --- a/src/system/boot/platform/efi/arch/arm/arch_mmu.cpp +++ b/src/system/boot/platform/efi/arch/arm/arch_mmu.cpp @@ -240,7 +240,7 @@ arch_mmu_allocate_page_tables(void) if (platform_allocate_region((void **)&sPageDirectory, ARM_MMU_L1_TABLE_SIZE + ALIGN_PAGEDIR + PAGE_TABLE_AREA_SIZE, 0, false) != B_OK) panic("Failed to allocate page directory."); - sPageDirectory = (uint32*)(((uint32)sPageDirectory + ALIGN_PAGEDIR - 1) & ~(ALIGN_PAGEDIR-1)); + sPageDirectory = (uint32 *)ROUNDUP((uint32)sPageDirectory, ALIGN_PAGEDIR); memset(sPageDirectory, 0, ARM_MMU_L1_TABLE_SIZE); sFirstPageTable = (uint32*)((uint32)sPageDirectory + ARM_MMU_L1_TABLE_SIZE);