MdePkg/DxeServicesLib: introduce AllocatePeiAccessiblePages routine

Add a routine to DxeServicesLib that abstracts the allocation of memory
that should be accessible by PEI after resuming from S3. We will use it
to replace open coded implementations that limit the address to < 4 GB,
which may not be possible on non-Intel systems that have no 32-bit
addressable memory at all.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Ard Biesheuvel
2018-05-24 10:44:01 +02:00
parent 97399f2d6f
commit a40e0b7aa9
4 changed files with 155 additions and 2 deletions

View File

@@ -27,12 +27,18 @@
LIBRARY_CLASS = DxeServicesLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER SMM_CORE UEFI_APPLICATION UEFI_DRIVER
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
# VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
#
[Sources]
DxeServicesLib.c
[Sources.IA32, Sources.IPF, Sources.EBC, Sources.ARM, Sources.AARCH64]
Allocate.c
[Sources.X64]
X64/Allocate.c
[Packages]
MdePkg/MdePkg.dec
@@ -44,6 +50,9 @@
UefiLib
UefiBootServicesTableLib
[LibraryClasses.X64]
HobLib
[Guids]
gEfiFileInfoGuid ## SOMETIMES_CONSUMES ## UNDEFINED