]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg, OvmfPkg: retire QemuFwCfgS3Enabled() from QemuFwCfgLib
authorLaszlo Ersek <lersek@redhat.com>
Wed, 22 Feb 2017 02:47:18 +0000 (03:47 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 14 Mar 2017 20:49:16 +0000 (21:49 +0100)
At this point we're ready to retire QemuFwCfgS3Enabled() from the
QemuFwCfgLib class, together with its implementations in:

- ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c

Extend all modules that call the function with a new QemuFwCfgS3Lib class
dependency. Thanks to the previously added library class, instances, and
class resolutions, we can do this switch now as tightly as possible.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=394
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
14 files changed:
ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf
OvmfPkg/Include/Library/QemuFwCfgLib.h
OvmfPkg/Library/LockBoxLib/LockBoxDxe.c
OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
OvmfPkg/PlatformPei/Platform.c
OvmfPkg/PlatformPei/PlatformPei.inf
OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c
OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf

index 9dd5c911fc5c24d5a88994ea88026591ab743bed..fba1684af2b2b06ffaf5d81e0a0b022552d97434 100644 (file)
@@ -637,20 +637,3 @@ QemuFwCfgFindFile (
 \r
   return RETURN_NOT_FOUND;\r
 }\r
-\r
-\r
-/**\r
-  Determine if S3 support is explicitly enabled.\r
-\r
-  @retval TRUE   if S3 support is explicitly enabled.\r
-          FALSE  otherwise. This includes unavailability of the firmware\r
-                 configuration interface.\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-QemuFwCfgS3Enabled (\r
-  VOID\r
-  )\r
-{\r
-  return FALSE;\r
-}\r
index bb5f14e0fc7ad80b9a7b690c7b0ce2d312f07da9..42edc97b3da2dc8cef767274f757b6c55fcd5333 100644 (file)
@@ -52,6 +52,7 @@
   UefiDriverEntryPoint\r
   HobLib\r
   QemuFwCfgLib\r
+  QemuFwCfgS3Lib\r
   MemoryAllocationLib\r
   BaseLib\r
   DxeServicesTableLib\r
index 6a0ecd1ad96260d9bf8e5d0142d1e908698d42ab..76512534f5e0ca7fb1315ee7832338011482462b 100644 (file)
@@ -19,6 +19,7 @@
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/QemuFwCfgLib.h>\r
+#include <Library/QemuFwCfgS3Lib.h>\r
 #include <Library/DxeServicesTableLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/OrderedCollectionLib.h>\r
index e550ff5a4714319f753dab4eb801ee56dcba444b..a9350540215d591ffbafedbfaf8f152be582edbd 100644 (file)
@@ -44,6 +44,7 @@
   MemoryAllocationLib\r
   OrderedCollectionLib\r
   QemuFwCfgLib\r
+  QemuFwCfgS3Lib\r
   UefiBootServicesTableLib\r
   UefiDriverEntryPoint\r
 \r
index 2a1261327b01ace81812d75cd6c1ea5e20c46bb5..596e3f25d5fe42645244067bd5abd7789e7d98e8 100644 (file)
@@ -179,19 +179,5 @@ QemuFwCfgFindFile (
   OUT  UINTN                 *Size\r
   );\r
 \r
-\r
-/**\r
-  Determine if S3 support is explicitly enabled.\r
-\r
-  @retval  TRUE   if S3 support is explicitly enabled.\r
-           FALSE  otherwise. This includes unavailability of the firmware\r
-                  configuration interface.\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-QemuFwCfgS3Enabled (\r
-  VOID\r
-  );\r
-\r
 #endif\r
 \r
index 818646a275a9446c17def47bf2f2771a49d95d1a..3da9cd21e5c9be067dfe573aa711ee7f427964e6 100644 (file)
@@ -19,6 +19,7 @@
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/QemuFwCfgLib.h>\r
+#include <Library/QemuFwCfgS3Lib.h>\r
 #include <Protocol/LockBox.h>\r
 #include <LockBoxLib.h>\r
 \r
index bedf1811e0b2293a883a7420ca2238a5308e9c90..eb03f4f546bcda2378e4c4f8b0d5922661b33925 100644 (file)
@@ -40,6 +40,7 @@
   DebugLib\r
   UefiBootServicesTableLib\r
   QemuFwCfgLib\r
+  QemuFwCfgS3Lib\r
 \r
 [Protocols]\r
   gEfiLockBoxProtocolGuid    ## SOMETIMES_PRODUCES\r
index ec58efa5ef4a69b9fe7052990949d13dc1c9521e..97ffbb51482524695ffb914903bf2b226a5fad86 100644 (file)
@@ -48,6 +48,7 @@ Abstract:
 #include <Library/IoLib.h>\r
 #include <Library/NvVarsFileLib.h>\r
 #include <Library/QemuFwCfgLib.h>\r
+#include <Library/QemuFwCfgS3Lib.h>\r
 #include <Library/QemuBootOrderLib.h>\r
 \r
 #include <Protocol/Decompress.h>\r
index f9e35c955d4d2167e182108eb974b956d8642c39..27789b7377bcb8bdcb17b0442ed751437fc21c84 100644 (file)
@@ -52,6 +52,7 @@
   PciLib\r
   NvVarsFileLib\r
   QemuFwCfgLib\r
+  QemuFwCfgS3Lib\r
   LoadLinuxLib\r
   QemuBootOrderLib\r
   UefiLib\r
index 3dd55ba5042ea4f1ef28d1895b0a4497e0504c89..1bf725d8b7ae8ce46e8a42d31a3fb727ed1f1017 100644 (file)
@@ -368,31 +368,3 @@ QemuFwCfgFindFile (
 \r
   return RETURN_NOT_FOUND;\r
 }\r
-\r
-\r
-/**\r
-  Determine if S3 support is explicitly enabled.\r
-\r
-  @retval  TRUE   if S3 support is explicitly enabled.\r
-           FALSE  otherwise. This includes unavailability of the firmware\r
-                  configuration interface.\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-QemuFwCfgS3Enabled (\r
-  VOID\r
-  )\r
-{\r
-  RETURN_STATUS        Status;\r
-  FIRMWARE_CONFIG_ITEM FwCfgItem;\r
-  UINTN                FwCfgSize;\r
-  UINT8                SystemStates[6];\r
-\r
-  Status = QemuFwCfgFindFile ("etc/system-states", &FwCfgItem, &FwCfgSize);\r
-  if (Status != RETURN_SUCCESS || FwCfgSize != sizeof SystemStates) {\r
-    return FALSE;\r
-  }\r
-  QemuFwCfgSelectItem (FwCfgItem);\r
-  QemuFwCfgReadBytes (sizeof SystemStates, SystemStates);\r
-  return (BOOLEAN) (SystemStates[3] & BIT7);\r
-}\r
index 0be86722e548e0db6c1f259348f692c31faeb3d1..77a8a16c15b8b58485d9b0307732dfad26769613 100644 (file)
@@ -32,6 +32,7 @@
 #include <Library/PeimEntryPoint.h>\r
 #include <Library/PeiServicesLib.h>\r
 #include <Library/QemuFwCfgLib.h>\r
+#include <Library/QemuFwCfgS3Lib.h>\r
 #include <Library/ResourcePublicationLib.h>\r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Ppi/MasterBootMode.h>\r
index fbaed3182dcfce643d130c5a58b59394fd7954e5..53c6dd445a0ec203a418211a7fc2d1ee18b94e33 100644 (file)
@@ -58,6 +58,7 @@
   PeiServicesTablePointerLib\r
   PeimEntryPoint\r
   QemuFwCfgLib\r
+  QemuFwCfgS3Lib\r
   MtrrLib\r
   PcdLib\r
 \r
index f31646d73461fa457ac7751f2518351fbe5144af..bb79fce0855be57cccd9656e3b4edd9c250a7dcd 100644 (file)
@@ -32,6 +32,7 @@
 #include <Library/PcdLib.h>\r
 #include <Library/PciLib.h>\r
 #include <Library/QemuFwCfgLib.h>\r
+#include <Library/QemuFwCfgS3Lib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Protocol/S3SaveState.h>\r
 #include <Protocol/SmmControl2.h>\r
index 31c80bd4448cd5d4c2bd7be7173619ec6a6aafca..04b1ed0e4eb3dac379b3afd556698c3630ed34ff 100644 (file)
@@ -56,6 +56,7 @@
   PcdLib\r
   PciLib\r
   QemuFwCfgLib\r
+  QemuFwCfgS3Lib\r
   UefiBootServicesTableLib\r
   UefiDriverEntryPoint\r
 \r