efi arm: use kernel args allocator built-in alignment feature
No need to manually align allocations, the kernel can do it. Change-Id: Ib5b271df0a44f0ed3d8af584b9a881b1d35120a3 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10110 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
3d2b40d59e
commit
d0d8228843
@@ -122,13 +122,11 @@ arch_start_kernel(addr_t kernelEntry)
|
|||||||
// Allocate a buffer twice as large as needed just in case it gets bigger
|
// Allocate a buffer twice as large as needed just in case it gets bigger
|
||||||
// between calls to ExitBootServices.
|
// between calls to ExitBootServices.
|
||||||
size_t actualMemoryMapSize = memoryMapSize * 2;
|
size_t actualMemoryMapSize = memoryMapSize * 2;
|
||||||
efi_memory_descriptor *memoryMap
|
|
||||||
= (efi_memory_descriptor *)kernel_args_malloc(actualMemoryMapSize +
|
|
||||||
ALIGN_MEMORY_MAP);
|
|
||||||
|
|
||||||
// align memory_map to 4-byte boundary
|
// align memory_map to 4-byte boundary
|
||||||
// otherwise we get alignment exception when calling GetMemoryMap below
|
// otherwise we get alignment exception when calling GetMemoryMap below
|
||||||
memoryMap = (efi_memory_descriptor *)ROUNDUP((uint32_t)memoryMap, ALIGN_MEMORY_MAP);
|
efi_memory_descriptor *memoryMap
|
||||||
|
= (efi_memory_descriptor *)kernel_args_malloc(actualMemoryMapSize,
|
||||||
|
ALIGN_MEMORY_MAP);
|
||||||
|
|
||||||
if (memoryMap == NULL)
|
if (memoryMap == NULL)
|
||||||
panic("Unable to allocate memory map.");
|
panic("Unable to allocate memory map.");
|
||||||
|
|||||||
Reference in New Issue
Block a user