From: Michael Kinney <michael.d.kinney@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>, Jeff Fan <jeff.fan@intel.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Laszlo Ersek <lersek@redhat.com>
Subject: [Patch 1/3] UefiCpuPkg/CpuS3DataDxe: Consume PcdAcpiS3Enable to control the code
Date: Thu, 18 Aug 2016 00:09:28 -0700 [thread overview]
Message-ID: <1471504170-11800-2-git-send-email-michael.d.kinney@intel.com> (raw)
In-Reply-To: <1471504170-11800-1-git-send-email-michael.d.kinney@intel.com>
From: Star Zeng <star.zeng@intel.com>
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>
---
UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c | 5 +++++
UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf | 2 ++
2 files changed, 7 insertions(+)
diff --git a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c b/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
index 7bd928f..3489b95 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 608e19f..480c98e 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
--
2.6.3.windows.1
next prev parent reply other threads:[~2016-08-18 7:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-18 7:09 [Patch 0/3] Use PcdAcpiS3Enable in CpuS3DataDxe and PiSmmCpuDxeSmm Michael Kinney
2016-08-18 7:09 ` Michael Kinney [this message]
2016-08-18 7:09 ` [Patch 2/3] UefiCpuPkg/PiSmmCpuDxeSmm: Move S3 related code to CpuS3.c Michael Kinney
2016-08-18 7:09 ` [Patch 3/3] UefiCpuPkg/PiSmmCpuDxeSmm: Consume PcdAcpiS3Enable to control the code Michael Kinney
2016-08-23 13:59 ` [Patch 0/3] Use PcdAcpiS3Enable in CpuS3DataDxe and PiSmmCpuDxeSmm Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1471504170-11800-2-git-send-email-michael.d.kinney@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox