/**@file\r
Memory Detection for Virtual Machines.\r
\r
- Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#include "Platform.h"\r
#include "Cmos.h"\r
\r
-STATIC\r
-UINTN\r
+UINT32\r
GetSystemMemorySizeBelow4gb (\r
+ VOID\r
)\r
{\r
UINT8 Cmos0x34;\r
\r
\r
/**\r
- Peform Memory Detection\r
-\r
- @return Top of memory\r
+ Peform Memory Detection for QEMU / KVM\r
\r
**/\r
-EFI_PHYSICAL_ADDRESS\r
-MemDetect (\r
+STATIC\r
+VOID\r
+QemuInitializeRam (\r
+ VOID\r
)\r
{\r
UINT64 LowerMemorySize;\r
UINT64 UpperMemorySize;\r
\r
- DEBUG ((EFI_D_ERROR, "MemDetect called\n"));\r
+ DEBUG ((EFI_D_INFO, "%a called\n", __FUNCTION__));\r
\r
//\r
// Determine total memory size available\r
LowerMemorySize = GetSystemMemorySizeBelow4gb ();\r
UpperMemorySize = GetSystemMemorySizeAbove4gb ();\r
\r
- PublishPeiMemory ();\r
-\r
//\r
// Create memory HOBs\r
//\r
\r
MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack);\r
}\r
-\r
- return LowerMemorySize;\r
}\r
\r
+/**\r
+ Publish system RAM and reserve memory regions\r
+\r
+**/\r
+VOID\r
+InitializeRamRegions (\r
+ VOID\r
+ )\r
+{\r
+ if (!mXen) {\r
+ QemuInitializeRam ();\r
+ } else {\r
+ XenPublishRamRegions ();\r
+ }\r
+}\r