public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 2/2] MdeModulePkg/AcpiPlatformDxe: Consume PlatformAcpiLib.
       [not found] <d02fd0f0808871fe5e596e8fec36ed258779b82b.1525821395.git.Marvin.Haeuser@outlook.com>
@ 2018-05-08 23:27 ` Marvin Häuser
  0 siblings, 0 replies; only message in thread
From: Marvin Häuser @ 2018-05-08 23:27 UTC (permalink / raw)
  To: edk2-devel@lists.01.org
  Cc: star.zeng@intel.com, eric.dong@intel.com, ruiyu.ni@intel.com

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.Haeuser@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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-08 23:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <d02fd0f0808871fe5e596e8fec36ed258779b82b.1525821395.git.Marvin.Haeuser@outlook.com>
2018-05-08 23:27 ` [PATCH 2/2] MdeModulePkg/AcpiPlatformDxe: Consume PlatformAcpiLib Marvin Häuser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox