]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c
MdeModulePkg BootScriptExecutorDxe: Consume PcdAcpiS3Enable to control the code
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / BootScriptExecutorDxe / ScriptExecute.c
index 97df37b7abe48dbff51b2430443f52202ed1e750..10493bea021bbb46f183a8d0700533dcabac5e69 100644 (file)
@@ -4,7 +4,7 @@
   This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory\r
   in the entry point. The functionality is to interpret and restore the S3 boot script\r
 \r
-Copyright (c) 2006 - 2015, 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 of the BSD License\r
@@ -308,9 +308,9 @@ ReadyToLockEventNotify (
   Status = PeCoffLoaderGetImageInfo (&ImageContext);\r
   ASSERT_EFI_ERROR (Status);\r
   if (ImageContext.SectionAlignment > EFI_PAGE_SIZE) {\r
-    Pages = EFI_SIZE_TO_PAGES (ImageContext.ImageSize + ImageContext.SectionAlignment);\r
+    Pages = EFI_SIZE_TO_PAGES ((UINTN) (ImageContext.ImageSize + ImageContext.SectionAlignment));\r
   } else {\r
-    Pages = EFI_SIZE_TO_PAGES (ImageContext.ImageSize);\r
+    Pages = EFI_SIZE_TO_PAGES ((UINTN) ImageContext.ImageSize);\r
   }\r
   FfsBuffer = 0xFFFFFFFF;\r
   Status = gBS->AllocatePages (\r
@@ -403,6 +403,10 @@ BootScriptExecutorEntryPoint (
   UINT32                                        RegEax;\r
   UINT32                                        RegEdx;\r
 \r
+  if (!PcdGetBool (PcdAcpiS3Enable)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   //\r
   // Test if the gEfiCallerIdGuid of this image is already installed. if not, the entry\r
   // point is loaded by DXE code which is the first time loaded. or else, it is already\r