From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ml01.01.org (Postfix) with ESMTP id C349E1A1E00 for ; Thu, 18 Aug 2016 00:09:36 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 18 Aug 2016 00:09:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,537,1464678000"; d="scan'208";a="1027504449" Received: from fbohra-mobl.amr.corp.intel.com (HELO mdkinney-MOBL.amr.corp.intel.com) ([10.255.231.76]) by fmsmga001.fm.intel.com with ESMTP; 18 Aug 2016 00:09:36 -0700 From: Michael Kinney To: edk2-devel@lists.01.org Cc: Star Zeng , Jeff Fan , Jiewen Yao , Laszlo Ersek Date: Thu, 18 Aug 2016 00:09:28 -0700 Message-Id: <1471504170-11800-2-git-send-email-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.6.3.windows.1 In-Reply-To: <1471504170-11800-1-git-send-email-michael.d.kinney@intel.com> References: <1471504170-11800-1-git-send-email-michael.d.kinney@intel.com> Subject: [Patch 1/3] UefiCpuPkg/CpuS3DataDxe: Consume PcdAcpiS3Enable to control the code X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2016 07:09:36 -0000 From: Star Zeng If PcdAcpiS3Enable is disabled, then return an EFI_UNSUPPORTED error which forces the module to be unloaded. Cc: Jeff Fan Cc: Jiewen Yao Cc: Michael Kinney Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jeff Fan --- 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