]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/LockBoxLib: use PcdAcpiS3Enable to detect S3 support
authorLin, Gary (HPS OE-Linux) <gary.lin@hpe.com>
Tue, 31 Aug 2021 01:31:13 +0000 (09:31 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 31 Aug 2021 11:07:16 +0000 (11:07 +0000)
To avoid the potential inconsistency between PcdAcpiS3Enable and
QemuFwCfgS3Enabled(), this commit modifies LockBoxLib to detect
S3 support by PcdAcpiS3Enable as modules in MdeModulePkg do.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3573
Signed-off-by: Gary Lin <gary.lin@hpe.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Tested-by: Jim Fehlig <jfehlig@suse.com>
OvmfPkg/Library/LockBoxLib/LockBoxDxe.c
OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf

index b28ad4d2dba70b71df04493a8ca65d750ee82c0a..7dc2eea2395a23ebe3dfa97419f3132250506840 100644 (file)
@@ -12,8 +12,6 @@
 #include <Library/UefiBootServicesTableLib.h>\r
 #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
@@ -117,7 +115,7 @@ LockBoxDxeLibInitialize (
 \r
   Status = LockBoxLibInitialize ();\r
   if (!EFI_ERROR (Status)) {\r
-    if (QemuFwCfgS3Enabled ()) {\r
+    if (PcdGetBool (PcdAcpiS3Enable)) {\r
       //\r
       // When S3 enabled, the first driver run with this library linked will\r
       // have this library constructor to install LockBox protocol on the\r
index 38bcc577084a59f2e31a423f7271be6a38a8f512..9140b1ba9de928e552da5b0ac7c539c53eb18429 100644 (file)
@@ -33,8 +33,6 @@
   BaseMemoryLib\r
   DebugLib\r
   UefiBootServicesTableLib\r
-  QemuFwCfgLib\r
-  QemuFwCfgS3Lib\r
 \r
 [Protocols]\r
   gEfiLockBoxProtocolGuid    ## SOMETIMES_PRODUCES\r
@@ -42,6 +40,7 @@
 [Pcd]\r
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase\r
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable\r
 \r
 [FeaturePcd]\r
   gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire\r