]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg S3SaveStateDxe: Consume PcdAcpiS3Enable to control the code
authorStar Zeng <star.zeng@intel.com>
Thu, 7 Apr 2016 10:19:25 +0000 (18:19 +0800)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 7 Apr 2016 15:32:03 +0000 (17:32 +0200)
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jiewen Yao <jiewen.yao@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: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Universal/Acpi/S3SaveStateDxe/InternalS3SaveState.h
MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c
MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf

index f5ca60611e020b4b23a42a3ac1054ecc3ecc49d6..5ee1c41f70de365ac028acedfa796d7411ed4c89 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Internal header file for S3 Boot Script Saver state driver.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
@@ -26,6 +26,7 @@
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/S3BootScriptLib.h>\r
 #include <Library/SmbusLib.h>\r
+#include <Library/PcdLib.h>\r
 #include <IndustryStandard/SmBus.h>\r
 /**\r
   Adds a record into S3 boot script table.\r
index 60cd9b1b3be678cc9449a910dd3f5d3ac7dc24b1..ddf856ec489a60ae317dcb4ed049066fe3b67753 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation for S3 Boot Script Saver state driver.\r
 \r
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
@@ -907,6 +907,9 @@ InitializeS3SaveState (
   )\r
 {\r
 \r
+  if (!PcdGetBool (PcdAcpiS3Enable)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
 \r
   return  gBS->InstallProtocolInterface (\r
                   &mHandle,\r
index 2f021ed90a3086789d97047d6f25533e7b50f44f..304805a03e6cf200057ac7c2a3958974fa483789 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 # It will install S3 Save State protocol to store or record various IO operations to be replayed during an S3 resume.\r
 #\r
-# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are\r
 # licensed and made available under the terms and conditions of the BSD License\r
   BaseMemoryLib\r
   BaseLib\r
   S3BootScriptLib\r
+  PcdLib\r
 \r
 [Protocols]\r
   gEfiS3SaveStateProtocolGuid                ## PRODUCES\r
 \r
 \r
+[Pcd]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable             ## CONSUMES\r
+\r
 [Depex]\r
   TRUE\r
 \r