mirror_edk2/IntelFrameworkModulePkg
Laszlo Ersek dbaeca276b IntelFrameworkModulePkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback
We are preparing for detaching the S3Ready() functionality from the
EFI_ACPI_S3_SAVE_PROTOCOL.S3Save() protocol member function. Instead, we
will hook the same logic to the End-of-Dxe event group.

The EFI_ACPI_S3_SAVE_PROTOCOL has another member: GetLegacyMemorySize().
According to the documenation,

  This function returns the size of the legacy memory (meaning below 1 MB)
  that is required during an S3 resume. Before the Framework-based
  firmware transfers control to the OS, it has to transition from flat
  mode into real mode in case the OS supplies only a real-mode waking
  vector. This transition requires a certain amount of legacy memory.
  After getting the size of legacy memory below, the caller is responsible
  for allocating the legacy memory below 1 MB according to the size that
  is returned. The specific implementation of allocating the legacy memory
  is out of the scope of this specification.

When EFI_ACPI_S3_SAVE_PROTOCOL.S3Save() is called, the address of the
legacy memory allocated above must be passed to it, in the
LegacyMemoryAddress parameter.

In practice however:

- The S3Ready() function ignores the LegacyMemoryAddress completely.

- No code in the edk2 tree calls
  EFI_ACPI_S3_SAVE_PROTOCOL.GetLegacyMemorySize(), ever.

- All callers of EFI_ACPI_S3_SAVE_PROTOCOL.S3Save() in the edk2 tree pass
  a NULL LegacyMemoryAddress:

  BdsLibBootViaBootOption()
  [IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c]

  OnReadyToBoot()
  [Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c]

  InstallReadyToLock()
  [Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c]

  BdsLibBootViaBootOption()
  [Vlv2TbltDevicePkg/Override/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c]

For this reason, ASSERT() explicitly that LegacyGetS3MemorySize() is never
called, and that the LegacyMemoryAddress parameter is always NULL.

This fact is important to capture in the code, because in the End-of-Dxe
callback, no LegacyMemoryAddress parameter can be taken. So let's make it
clear that we actually don't even have any use for that parameter.

Cc: Yao Jiewen <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: Tim He <tim.he@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17804 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02 06:36:19 +00:00
..
Bus IntelFrameworkModulePkg IsaFloppyDxe: Use safe string functions 2015-06-30 06:25:29 +00:00
Csm IntelFrameworkModulePkg: Add UEFI2.5 PersistentMemory support in LegacyBios 2015-04-29 01:38:01 +00:00
Include IntelFrameworkModulePkg: Move LzmaDecompress GUID 2015-04-03 02:49:10 +00:00
Library IntelFrameworkModulePkg PeiDxeDebugLib: Use safe string functions 2015-06-30 06:26:20 +00:00
Universal IntelFrameworkModulePkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback 2015-07-02 06:36:19 +00:00
Contributions.txt */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
IntelFrameworkModulePkg.dec Remove obsolete PCDs (new ones are moved to MdePkg and MdeModulePkg) 2015-05-06 04:51:19 +00:00
IntelFrameworkModulePkg.dsc IntelFrameworkModulePkg: Add LegacyBootManagerLib. 2015-05-06 04:50:23 +00:00
IntelFrameworkModulePkg.uni IntelFrameworkModulePkg: Convert non DOS format files to DOS format 2014-09-03 08:45:37 +00:00
IntelFrameworkModulePkgExtra.uni IntelFrameworkModulePkg: INF/DEC file updates to EDK II packages 2014-08-28 07:03:47 +00:00
License.txt Update copyright format 2012-04-24 06:49:39 +00:00