MdeModulePkg/AcpiTableDxe: use pool allocations when possible

On AArch64 systems, page based allocations for memory types that are
relevant to the OS are rounded up to 64 KB multiples. This wastes
some space in the ACPI table memory allocator, since it uses page
based allocations in order to be able to place the ACPI tables low
in memory.

Since the latter requirement does not exist on AArch64, switch to pool
allocations for all ACPI tables except the root tables if the active
allocation policy permits them to be anywhere in memory. The root
tables will be handled in a subsequent patch.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Ard Biesheuvel
2020-10-16 16:36:08 +02:00
committed by mergify[bot]
parent 8cadcaa13d
commit 0e0ae47da6
3 changed files with 66 additions and 28 deletions

View File

@@ -68,8 +68,8 @@ FindTableByBuffer (
while (CurrentLink != StartLink) {
CurrentTableList = EFI_ACPI_TABLE_LIST_FROM_LINK (CurrentLink);
if (((UINTN)CurrentTableList->PageAddress <= (UINTN)Buffer) &&
((UINTN)CurrentTableList->PageAddress + EFI_PAGES_TO_SIZE(CurrentTableList->NumberOfPages) > (UINTN)Buffer)) {
if (((UINTN)CurrentTableList->Table <= (UINTN)Buffer) &&
((UINTN)CurrentTableList->Table + CurrentTableList->TableSize > (UINTN)Buffer)) {
//
// Good! Found Table.
//