pmm: Fix AllocatePages() call to take pages count; remove useless alignment check

This commit is contained in:
mintsuki 2022-10-17 04:41:11 +02:00
parent 7d0ef9ef24
commit f3357648ab
1 changed files with 2 additions and 3 deletions

View File

@ -403,11 +403,10 @@ void init_memmap(void) {
if (status) {
for (size_t j = 0; j < memmap[i].length; j += 4096) {
uint64_t length = memmap[i].length - j < 4096 ? memmap[i].length - j : 4096;
base = memmap[i].base + j;
status = gBS->AllocatePages(AllocateAddress, EfiLoaderData, length, &base);
status = gBS->AllocatePages(AllocateAddress, EfiLoaderData, 1, &base);
if (status) {
memmap_alloc_range(base, length, MEMMAP_EFI_RECLAIMABLE, MEMMAP_USABLE, true, false, false);
memmap_alloc_range(base, 4096, MEMMAP_EFI_RECLAIMABLE, MEMMAP_USABLE, true, false, false);
}
}
}