From 125e093876414028582132147dc1372ae420dbff Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Thu, 7 Apr 2016 18:19:25 +0800 Subject: [PATCH] MdeModulePkg S3SaveStateDxe: Consume PcdAcpiS3Enable to control the code Cc: Feng Tian Cc: Jiewen Yao Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek Reviewed-by: Jiewen Yao --- .../Universal/Acpi/S3SaveStateDxe/InternalS3SaveState.h | 3 ++- MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c | 5 ++++- .../Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/InternalS3SaveState.h b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/InternalS3SaveState.h index f5ca60611e..5ee1c41f70 100644 --- a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/InternalS3SaveState.h +++ b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/InternalS3SaveState.h @@ -1,7 +1,7 @@ /** @file Internal header file for S3 Boot Script Saver state driver. - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions @@ -26,6 +26,7 @@ #include #include #include +#include #include /** Adds a record into S3 boot script table. diff --git a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c index 60cd9b1b3b..ddf856ec48 100644 --- a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c +++ b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c @@ -1,7 +1,7 @@ /** @file Implementation for S3 Boot Script Saver state driver. - Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions @@ -907,6 +907,9 @@ InitializeS3SaveState ( ) { + if (!PcdGetBool (PcdAcpiS3Enable)) { + return EFI_UNSUPPORTED; + } return gBS->InstallProtocolInterface ( &mHandle, diff --git a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf index 2f021ed90a..304805a03e 100644 --- a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf +++ b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf @@ -3,7 +3,7 @@ # # It will install S3 Save State protocol to store or record various IO operations to be replayed during an S3 resume. # -# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are # licensed and made available under the terms and conditions of the BSD License @@ -47,11 +47,15 @@ BaseMemoryLib BaseLib S3BootScriptLib + PcdLib [Protocols] gEfiS3SaveStateProtocolGuid ## PRODUCES +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable ## CONSUMES + [Depex] TRUE