diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2014-03-04 08:02:16 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-03-04 08:02:16 +0000 |
commit | 8e54500fd48b56d8cf660c18656e10fe89ee3af7 (patch) | |
tree | f8bc0c4a69413e465654b2b726839fdb4574f65a /OvmfPkg/PlatformPei | |
parent | 7cdba6346b97562dad9809297cd7a32979a5a1d8 (diff) | |
download | edk2-platforms-8e54500fd48b56d8cf660c18656e10fe89ee3af7.tar.xz |
OvmfPkg: Add section of memory to use for PEI on S3 resume
This 32k section of RAM will be declared to the PEI Core on
S3 resume to allow memory allocations during S3 resume PEI.
If the boot mode is BOOT_ON_S3_RESUME, then we publish
the pre-reserved PcdS3AcpiReservedMemory range to PEI.
If the boot mode is not BOOT_ON_S3_RESUME, then we reserve
this range as ACPI NVS so the OS will not use it.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15294 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/PlatformPei')
-rw-r--r-- | OvmfPkg/PlatformPei/MemDetect.c | 36 | ||||
-rw-r--r-- | OvmfPkg/PlatformPei/PlatformPei.inf | 5 |
2 files changed, 30 insertions, 11 deletions
diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c index 29df5370b0..11c79687c4 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -99,16 +99,21 @@ PublishPeiMemory ( UINT64 MemorySize;
UINT64 LowerMemorySize;
- LowerMemorySize = GetSystemMemorySizeBelow4gb ();
-
- //
- // Determine the range of memory to use during PEI
- //
- MemoryBase = PcdGet32 (PcdOvmfDxeMemFvBase) + PcdGet32 (PcdOvmfDxeMemFvSize);
- MemorySize = LowerMemorySize - MemoryBase;
- if (MemorySize > SIZE_64MB) {
- MemoryBase = LowerMemorySize - SIZE_64MB;
- MemorySize = SIZE_64MB;
+ if (mBootMode == BOOT_ON_S3_RESUME) {
+ MemoryBase = PcdGet32 (PcdS3AcpiReservedMemoryBase);
+ MemorySize = PcdGet32 (PcdS3AcpiReservedMemorySize);
+ } else {
+ LowerMemorySize = GetSystemMemorySizeBelow4gb ();
+
+ //
+ // Determine the range of memory to use during PEI
+ //
+ MemoryBase = PcdGet32 (PcdOvmfDxeMemFvBase) + PcdGet32 (PcdOvmfDxeMemFvSize);
+ MemorySize = LowerMemorySize - MemoryBase;
+ if (MemorySize > SIZE_64MB) {
+ MemoryBase = LowerMemorySize - SIZE_64MB;
+ MemorySize = SIZE_64MB;
+ }
}
//
@@ -173,4 +178,15 @@ InitializeRamRegions ( } else {
XenPublishRamRegions ();
}
+
+ if (mS3Supported && mBootMode != BOOT_ON_S3_RESUME) {
+ //
+ // This is the memory range that will be used for PEI on S3 resume
+ //
+ BuildMemoryAllocationHob (
+ (EFI_PHYSICAL_ADDRESS)(UINTN) PcdGet32 (PcdS3AcpiReservedMemoryBase),
+ (UINT64)(UINTN) PcdGet32 (PcdS3AcpiReservedMemorySize),
+ EfiACPIMemoryNVS
+ );
+ }
}
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf index ad620350a2..abd05676d6 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -2,7 +2,7 @@ # Platform PEI driver
#
# This module provides platform specific function to detect boot mode.
-# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -36,6 +36,7 @@ Xen.c
[Packages]
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
UefiCpuPkg/UefiCpuPkg.dec
@@ -64,6 +65,8 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
+ gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
|