]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: AcpiS3SaveDxe: drop EFI_ACPI_S3_SAVE_PROTOCOL
authorLaszlo Ersek <lersek@redhat.com>
Sun, 26 Jul 2015 08:02:29 +0000 (08:02 +0000)
committerjljusten <jljusten@Edk2>
Sun, 26 Jul 2015 08:02:29 +0000 (08:02 +0000)
At this point, nothing in the OVMF build calls EFI_ACPI_S3_SAVE_PROTOCOL
member functions; simplify the code by dropping this protocol interface.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18038 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.h [deleted file]
OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf

index 8372db85bdb5a899b75fbc71c501efabcbc186ff..2e1040b612bfcb9f75b12718106b464c3297e7e2 100644 (file)
@@ -1,6 +1,9 @@
 /** @file\r
-  This is an implementation of the ACPI S3 Save protocol.  This is defined in\r
-  S3 boot path specification 0.9.\r
+  This is a replacement for the ACPI S3 Save protocol.\r
+\r
+  The ACPI S3 Save protocol used to be defined in the S3 boot path\r
+  specification 0.9. Instead, the same functionality is now hooked to the\r
+  End-of-Dxe event.\r
 \r
 Copyright (c) 2014-2015, Red Hat, Inc.<BR>\r
 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
@@ -30,19 +33,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/AcpiS3Context.h>\r
 #include <Guid/Acpi.h>\r
 #include <Guid/EventGroup.h>\r
-#include <Protocol/AcpiS3Save.h>\r
 #include <Protocol/LockBox.h>\r
 #include <IndustryStandard/Acpi.h>\r
 \r
-#include "AcpiS3Save.h"\r
-\r
-UINTN     mLegacyRegionSize;\r
-\r
-EFI_ACPI_S3_SAVE_PROTOCOL mS3Save = {\r
-  LegacyGetS3MemorySize,\r
-  S3Ready,\r
-};\r
-\r
 EFI_GUID              mAcpiS3IdtrProfileGuid = {\r
   0xdea652b0, 0xd587, 0x4c54, { 0xb5, 0xb4, 0xc6, 0x82, 0xe7, 0xa0, 0xaa, 0x3d }\r
 };\r
@@ -384,53 +377,18 @@ S3CreateIdentityMappingPageTables (
   }\r
 }\r
 \r
-/**\r
-  Gets the buffer of legacy memory below 1 MB \r
-  This function is to get the buffer in legacy memory below 1MB that is required during S3 resume.\r
-\r
-  @param This           A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.\r
-  @param Size           The returned size of legacy memory below 1 MB.\r
-\r
-  @retval EFI_SUCCESS           Size is successfully returned.\r
-  @retval EFI_INVALID_PARAMETER The pointer Size is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-LegacyGetS3MemorySize (\r
-  IN  EFI_ACPI_S3_SAVE_PROTOCOL   *This,\r
-  OUT UINTN                       *Size\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-\r
-  if (Size == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *Size = mLegacyRegionSize;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
 /**\r
   Prepares all information that is needed in the S3 resume boot path.\r
   \r
   Allocate the resources or prepare informations and save in ACPI variable set for S3 resume boot path  \r
   \r
-  @param This                 A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.\r
-  @param LegacyMemoryAddress  The base address of legacy memory.\r
-\r
-  @retval EFI_NOT_FOUND         Some necessary information cannot be found.\r
   @retval EFI_SUCCESS           All information was saved successfully.\r
-  @retval EFI_OUT_OF_RESOURCES  Resources were insufficient to save all the information.\r
-  @retval EFI_INVALID_PARAMETER The memory range is not located below 1 MB.\r
-\r
 **/\r
+STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 S3Ready (\r
-  IN EFI_ACPI_S3_SAVE_PROTOCOL    *This,\r
-  IN VOID                         *LegacyMemoryAddress\r
+  VOID\r
   )\r
 {\r
   EFI_STATUS                                    Status;\r
@@ -442,17 +400,12 @@ S3Ready (
 \r
   DEBUG ((EFI_D_INFO, "S3Ready!\n"));\r
 \r
-  //\r
-  // Platform may invoke AcpiS3Save->S3Save() before ExitPmAuth, because we need save S3 information there, while BDS ReadyToBoot may invoke it again.\r
-  // So if 2nd S3Save() is triggered later, we need ignore it.\r
-  //\r
+  ASSERT (!AlreadyEntered);\r
   if (AlreadyEntered) {\r
     return EFI_SUCCESS;\r
   }\r
   AlreadyEntered = TRUE;\r
 \r
-  ASSERT (LegacyMemoryAddress == NULL);\r
-\r
   AcpiS3Context = AllocateMemoryBelow4G (EfiReservedMemoryType, sizeof(*AcpiS3Context));\r
   ASSERT (AcpiS3Context != NULL);\r
   AcpiS3ContextBuffer = (EFI_PHYSICAL_ADDRESS)(UINTN)AcpiS3Context;\r
@@ -539,13 +492,9 @@ OnEndOfDxe (
   EFI_STATUS Status;\r
 \r
   //\r
-  // Our S3Ready() function ignores both of its parameters, and always\r
-  // succeeds.\r
+  // Our S3Ready() function always succeeds.\r
   //\r
-  Status = S3Ready (\r
-             NULL, // This\r
-             NULL  // LegacyMemoryAddress\r
-             );\r
+  Status = S3Ready ();\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
@@ -559,8 +508,9 @@ OnEndOfDxe (
 /**\r
   The Driver Entry Point.\r
   \r
-  The function is the driver Entry point which will produce AcpiS3SaveProtocol.\r
-  \r
+  The function is the driver Entry point that will register the End-of-Dxe\r
+  callback.\r
+\r
   @param ImageHandle   A handle for the image that is initializing this driver\r
   @param SystemTable   A pointer to the EFI system table\r
 \r
@@ -571,7 +521,7 @@ OnEndOfDxe (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-InstallAcpiS3Save (\r
+InstallEndOfDxeCallback (\r
   IN EFI_HANDLE           ImageHandle,\r
   IN EFI_SYSTEM_TABLE     *SystemTable\r
   )\r
@@ -583,18 +533,8 @@ InstallAcpiS3Save (
     return EFI_LOAD_ERROR;\r
   }\r
 \r
-  if (!FeaturePcdGet(PcdPlatformCsmSupport)) {\r
-    //\r
-    // More memory for no CSM tip, because GDT need relocation\r
-    //\r
-    mLegacyRegionSize = 0x250;\r
-  } else {\r
-    mLegacyRegionSize = 0x100;\r
-  }\r
-\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &ImageHandle,\r
-                  &gEfiAcpiS3SaveProtocolGuid, &mS3Save,\r
                   &gEfiLockBoxProtocolGuid, NULL,\r
                   NULL\r
                   );\r
diff --git a/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.h b/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.h
deleted file mode 100644 (file)
index 65974a3..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/** @file\r
-  This is an implementation of the ACPI S3 Save protocol.  This is defined in \r
-  S3 boot path specification 0.9.\r
-\r
-Copyright (c) 2006 - 2012, 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
-of the BSD License which accompanies this distribution.  The\r
-full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef _ACPI_S3_SAVE_H_\r
-#define _ACPI_S3_SAVE_H_\r
-\r
-/**\r
-  Gets the buffer of legacy memory below 1 MB \r
-  This function is to get the buffer in legacy memory below 1MB that is required during S3 resume.\r
-\r
-  @param This           A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.\r
-  @param Size           The returned size of legacy memory below 1 MB.\r
-\r
-  @retval EFI_SUCCESS           Size is successfully returned.\r
-  @retval EFI_INVALID_PARAMETER The pointer Size is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-LegacyGetS3MemorySize (\r
-  IN  EFI_ACPI_S3_SAVE_PROTOCOL    * This,\r
-  OUT UINTN                        * Size\r
-  );\r
-\r
-/**\r
-  Prepares all information that is needed in the S3 resume boot path.\r
-  \r
-  Allocate the resources or prepare informations and save in ACPI variable set for S3 resume boot path  \r
-  \r
-  @param This                 A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.\r
-  @param LegacyMemoryAddress  The base address of legacy memory.\r
-\r
-  @retval EFI_NOT_FOUND         Some necessary information cannot be found.\r
-  @retval EFI_SUCCESS           All information was saved successfully.\r
-  @retval EFI_OUT_OF_RESOURCES  Resources were insufficient to save all the information.\r
-  @retval EFI_INVALID_PARAMETER The memory range is not located below 1 MB.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-S3Ready (\r
-  IN EFI_ACPI_S3_SAVE_PROTOCOL     *This,\r
-  IN VOID                          *LegacyMemoryAddress   \r
-  );\r
-#endif\r
index e657bbe8c56422bf642c8174b546d355131e3d75..4cc0713d1a4b032a5214b44be769b744d5938e05 100644 (file)
@@ -1,7 +1,6 @@
 ## @file\r
-# Component description file for AcpiS3Save module.\r
+# AcpiS3Save module installs EndOfDxe callback to prepare S3 boot data.\r
 #\r
-# This is an implementation of the ACPI S3 Save protocol.\r
 # Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are\r
@@ -21,7 +20,7 @@
   MODULE_TYPE                    = DXE_DRIVER\r
   VERSION_STRING                 = 1.0\r
 \r
-  ENTRY_POINT                    = InstallAcpiS3Save\r
+  ENTRY_POINT                    = InstallEndOfDxeCallback\r
 \r
 #\r
 # The following information is for reference only and not required by the build tools.\r
@@ -30,7 +29,6 @@
 #\r
 \r
 [Sources]\r
-  AcpiS3Save.h\r
   AcpiS3Save.c\r
 \r
 [Packages]\r
   gEfiEndOfDxeEventGroupGuid                    ## CONSUMES  ## Event\r
 \r
 [Protocols]\r
-  gEfiAcpiS3SaveProtocolGuid                    # PROTOCOL ALWAYS_PRODUCED\r
   gEfiLockBoxProtocolGuid                       # PROTOCOL ALWAYS_PRODUCED\r
   gEfiLegacyBiosProtocolGuid                    # PROTOCOL ALWAYS_CONSUMED\r
   gEfiLegacyRegion2ProtocolGuid                 # PROTOCOL SOMETIMES_CONSUMED\r
   gFrameworkEfiMpServiceProtocolGuid            # PROTOCOL SOMETIMES_CONSUMED\r
 \r
 [FeaturePcd]\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformCsmSupport          ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode\r
 \r
 [Pcd]\r