// variable MTRR suffices by truncating the size to a whole power of two,\r
// while keeping the end affixed to 4GB. This will round the base up.\r
//\r
- LowerMemorySize = GetSystemMemorySizeBelow4gb (PlatformInfoHob);\r
+ LowerMemorySize = PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob);\r
PlatformInfoHob->Uc32Size = GetPowerOfTwo32 ((UINT32)(SIZE_4GB - LowerMemorySize));\r
PlatformInfoHob->Uc32Base = (UINT32)(SIZE_4GB - PlatformInfoHob->Uc32Size);\r
//\r
}\r
\r
UINT32\r
-GetSystemMemorySizeBelow4gb (\r
+EFIAPI\r
+PlatformGetSystemMemorySizeBelow4gb (\r
IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob\r
)\r
{\r
UINT32 S3AcpiReservedMemoryBase;\r
UINT32 S3AcpiReservedMemorySize;\r
\r
- LowerMemorySize = GetSystemMemorySizeBelow4gb (&mPlatformInfoHob);\r
+ LowerMemorySize = PlatformGetSystemMemorySizeBelow4gb (&mPlatformInfoHob);\r
if (mPlatformInfoHob.SmmSmramRequire) {\r
//\r
// TSEG is chipped from the end of low RAM\r
**/\r
STATIC\r
VOID\r
-QemuInitializeRam (\r
+PlatformQemuInitializeRam (\r
IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob\r
)\r
{\r
//\r
// Determine total memory size available\r
//\r
- LowerMemorySize = GetSystemMemorySizeBelow4gb (PlatformInfoHob);\r
+ LowerMemorySize = PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob);\r
\r
if (PlatformInfoHob->BootMode == BOOT_ON_S3_RESUME) {\r
//\r
}\r
}\r
\r
-/**\r
- Publish system RAM and reserve memory regions\r
-\r
-**/\r
+STATIC\r
VOID\r
-InitializeRamRegions (\r
+PlatformQemuInitializeRamForS3 (\r
IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob\r
)\r
{\r
- QemuInitializeRam (PlatformInfoHob);\r
-\r
- SevInitializeRam ();\r
-\r
if (PlatformInfoHob->S3Supported && (PlatformInfoHob->BootMode != BOOT_ON_S3_RESUME)) {\r
//\r
// This is the memory range that will be used for PEI on S3 resume\r
//\r
TsegSize = PlatformInfoHob->Q35TsegMbytes * SIZE_1MB;\r
BuildMemoryAllocationHob (\r
- GetSystemMemorySizeBelow4gb (PlatformInfoHob) - TsegSize,\r
+ PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob) - TsegSize,\r
TsegSize,\r
EfiReservedMemoryType\r
);\r
#endif\r
}\r
}\r
+\r
+/**\r
+ Publish system RAM and reserve memory regions\r
+\r
+**/\r
+VOID\r
+InitializeRamRegions (\r
+ IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob\r
+ )\r
+{\r
+ PlatformQemuInitializeRam (PlatformInfoHob);\r
+\r
+ SevInitializeRam ();\r
+\r
+ PlatformQemuInitializeRamForS3 (PlatformInfoHob);\r
+}\r