This patch updates the generic ACPI Platform driver to consume PlatformAcpiLib to allow platform specific updates to the ACPI tables loaded from the configured Firmware Volume. This allows for more platforms to incorporate the generic ACPI Platform driver.
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser <marvin.haeu...@outlook.com> --- MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c | 55 ++++++++++++-------- MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 + 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c index 8f335bde0d46..f1243279faa2 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c +++ b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c @@ -21,6 +21,7 @@ #include <Library/UefiBootServicesTableLib.h> #include <Library/DebugLib.h> #include <Library/PcdLib.h> +#include <Library/PlatformAcpiLib.h> #include <IndustryStandard/Acpi.h> @@ -180,6 +181,7 @@ AcpiPlatformEntryPoint ( UINT32 FvStatus; UINTN TableSize; UINTN Size; + RETURN_STATUS Return; Instance = 0; CurrentTable = NULL; @@ -216,35 +218,42 @@ AcpiPlatformEntryPoint ( ); if (!EFI_ERROR(Status)) { // - // Add the table + // Perform any platform-specific table updates. // - TableHandle = 0; + Return = PlatformAcpiUpdateTable (CurrentTable); - TableSize = ((EFI_ACPI_DESCRIPTION_HEADER *) CurrentTable)->Length; - ASSERT (Size >= TableSize); + if (!RETURN_ERROR (Return)) { + // + // Add the table + // + TableHandle = 0; - // - // Checksum ACPI table - // - AcpiPlatformChecksum ((UINT8*)CurrentTable, TableSize); + TableSize = ((EFI_ACPI_DESCRIPTION_HEADER *) CurrentTable)->Length; + ASSERT (Size >= TableSize); - // - // Install ACPI table - // - Status = AcpiTable->InstallAcpiTable ( - AcpiTable, - CurrentTable, - TableSize, - &TableHandle - ); + // + // Checksum ACPI table + // + AcpiPlatformChecksum ((UINT8*)CurrentTable, TableSize); - // - // Free memory allocated by ReadSection - // - gBS->FreePool (CurrentTable); + // + // Install ACPI table + // + Status = AcpiTable->InstallAcpiTable ( + AcpiTable, + CurrentTable, + TableSize, + &TableHandle + ); + + // + // Free memory allocated by ReadSection + // + gBS->FreePool (CurrentTable); - if (EFI_ERROR(Status)) { - return EFI_ABORTED; + if (EFI_ERROR(Status)) { + return EFI_ABORTED; + } } // diff --git a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf index 34b1600171d5..114a12dc3396 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -40,6 +40,7 @@ [LibraryClasses] PcdLib BaseMemoryLib DebugLib + PlatformAcpiLib UefiBootServicesTableLib UefiDriverEntryPoint -- 2.17.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel