summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/CpuS3DataDxe
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2016-07-18 11:31:28 +0800
committerMichael Kinney <michael.d.kinney@intel.com>2016-09-01 08:18:59 -0700
commitca98f60382943d4b40a8e60125120edc4d69f212 (patch)
tree5a0c14a1985a46680c4d4b28bb81a1c4669ceb0d /UefiCpuPkg/CpuS3DataDxe
parent5322ee484b54bc78023383a546971b601dcc4ce1 (diff)
downloadedk2-ca98f60382943d4b40a8e60125120edc4d69f212.tar.gz
edk2-ca98f60382943d4b40a8e60125120edc4d69f212.tar.bz2
edk2-ca98f60382943d4b40a8e60125120edc4d69f212.zip
UefiCpuPkg/CpuS3DataDxe: Consume PcdAcpiS3Enable to control the code
If PcdAcpiS3Enable is disabled, then return an EFI_UNSUPPORTED error which forces the module to be unloaded. Cc: Jeff Fan <jeff.fan@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'UefiCpuPkg/CpuS3DataDxe')
-rw-r--r--UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c5
-rw-r--r--UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf2
2 files changed, 7 insertions, 0 deletions
diff --git a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c b/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
index 7bd928f330..3489b9549c 100644
--- a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
+++ b/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
@@ -133,6 +133,7 @@ CpuS3DataOnEndOfDxe (
@param[in] SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The entry point is executed successfully.
+ @retval EFI_UNSUPPORTED Do not support ACPI S3.
@retval other Some error occurs when executing this entry point.
**/
@@ -160,6 +161,10 @@ CpuS3DataInitialize (
VOID *Idt;
EFI_EVENT Event;
+ if (!PcdGetBool (PcdAcpiS3Enable)) {
+ return EFI_UNSUPPORTED;
+ }
+
//
// Allocate ACPI NVS memory below 4G memory for use on ACPI S3 resume.
//
diff --git a/UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf b/UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
index 608e19f5ef..480c98ebcd 100644
--- a/UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
+++ b/UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
@@ -41,6 +41,7 @@
[Packages]
MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
UefiCpuPkg/UefiCpuPkg.dec
[LibraryClasses]
@@ -60,6 +61,7 @@
[Pcd]
gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuS3DataAddress ## PRODUCES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable ## CONSUMES
[Depex]
gEfiMpServiceProtocolGuid