]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
Revert "OvmfPkg: link SM3 support into Tcg2Pei and Tcg2Dxe"
[mirror_edk2.git] / OvmfPkg / AcpiPlatformDxe / AcpiPlatform.c
index 6e0b6100b50f79df0ea3f316297db44e7dbfe68b..2b529d58a15c663cabefd7de1947de0e3649e37f 100644 (file)
@@ -2,13 +2,7 @@
   OVMF ACPI Platform Driver\r
 \r
   Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -130,14 +124,20 @@ LocateFvInstanceWithTables (
 \r
 \r
 /**\r
-  Find ACPI tables in an FV and parses them. This function is useful for QEMU and KVM.\r
+  Find ACPI tables in an FV and install them. \r
+\r
+  This is now a fall-back path. Normally, we will search for tables provided\r
+  by the VMM first.\r
+\r
+  If that fails, we use this function to load the ACPI tables from an FV. The\r
+  sources for the FV based tables is located under OvmfPkg/AcpiTables.\r
 \r
   @param  AcpiTable     Protocol instance pointer    \r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-FindAcpiTablesInFv (\r
+InstallOvmfFvTables (\r
   IN  EFI_ACPI_TABLE_PROTOCOL     *AcpiTable\r
   )\r
 {\r
@@ -161,6 +161,11 @@ FindAcpiTablesInFv (
     TableInstallFunction = InstallAcpiTable;\r
   }\r
 \r
+  //\r
+  // set FwVol (and use an ASSERT() below) to suppress incorrect\r
+  // compiler/analyzer warnings\r
+  //\r
+  FwVol = NULL;\r
   //\r
   // Locate the firmware volume protocol\r
   //\r
@@ -168,6 +173,8 @@ FindAcpiTablesInFv (
   if (EFI_ERROR (Status)) {\r
     return EFI_ABORTED;\r
   }\r
+  ASSERT (FwVol != NULL);\r
+\r
   //\r
   // Read tables from the storage file.\r
   //\r
@@ -222,7 +229,7 @@ FindAcpiTablesInFv (
 }\r
 \r
 /**\r
-  Entrypoint of Acpi Platform driver.\r
+  Effective entrypoint of Acpi Platform driver.\r
 \r
   @param  ImageHandle\r
   @param  SystemTable\r
@@ -234,38 +241,22 @@ FindAcpiTablesInFv (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-AcpiPlatformEntryPoint (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
+InstallAcpiTables (\r
+  IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiTable\r
   )\r
 {\r
   EFI_STATUS                         Status;\r
-  EFI_ACPI_TABLE_PROTOCOL            *AcpiTable;\r
-\r
-  //\r
-  // Find the AcpiTable protocol\r
-  //\r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiAcpiTableProtocolGuid,\r
-                  NULL,\r
-                  (VOID**)&AcpiTable\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_ABORTED;\r
-  }\r
 \r
   if (XenDetected ()) {\r
     Status = InstallXenTables (AcpiTable);\r
-    if (EFI_ERROR (Status)) {\r
-      Status = FindAcpiTablesInFv (AcpiTable);\r
-    }\r
   } else {\r
-    Status = FindAcpiTablesInFv (AcpiTable);\r
+    Status = InstallQemuFwCfgTables (AcpiTable);\r
   }\r
+\r
   if (EFI_ERROR (Status)) {\r
-    return Status;\r
+    Status = InstallOvmfFvTables (AcpiTable);\r
   }\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r