#include <Library/PeiServicesLib.h>\r
#include <Library/QemuFwCfgLib.h>\r
#include <Library/QemuFwCfgS3Lib.h>\r
+#include <Library/QemuFwCfgSimpleParserLib.h>\r
#include <Library/ResourcePublicationLib.h>\r
-#include <Guid/MemoryTypeInformation.h>\r
#include <Ppi/MasterBootMode.h>\r
#include <IndustryStandard/I440FxPiix4.h>\r
#include <IndustryStandard/Pci22.h>\r
#include "Platform.h"\r
#include "Cmos.h"\r
\r
-EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {\r
- { EfiACPIMemoryNVS, 0x004 },\r
- { EfiACPIReclaimMemory, 0x008 },\r
- { EfiReservedMemoryType, 0x004 },\r
- { EfiRuntimeServicesData, 0x024 },\r
- { EfiRuntimeServicesCode, 0x030 },\r
- { EfiBootServicesCode, 0x180 },\r
- { EfiBootServicesData, 0xF00 },\r
- { EfiMaxMemoryType, 0x000 }\r
-};\r
-\r
-\r
EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[] = {\r
{\r
EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
PciIoBase = 0xC000;\r
PciIoSize = 0x4000;\r
\r
- //\r
- // Create Memory Type Information HOB\r
- //\r
- BuildGuidDataHob (\r
- &gEfiMemoryTypeInformationGuid,\r
- mDefaultMemoryTypeInformation,\r
- sizeof(mDefaultMemoryTypeInformation)\r
- );\r
-\r
//\r
// Video memory + Legacy BIOS region\r
//\r
ASSERT_RETURN_ERROR (PcdStatus);\r
}\r
\r
-EFI_STATUS\r
-GetNamedFwCfgBoolean (\r
- IN CHAR8 *FwCfgFileName,\r
- OUT BOOLEAN *Setting\r
- )\r
-{\r
- EFI_STATUS Status;\r
- FIRMWARE_CONFIG_ITEM FwCfgItem;\r
- UINTN FwCfgSize;\r
- UINT8 Value[3];\r
-\r
- Status = QemuFwCfgFindFile (FwCfgFileName, &FwCfgItem, &FwCfgSize);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- if (FwCfgSize > sizeof Value) {\r
- return EFI_BAD_BUFFER_SIZE;\r
- }\r
- QemuFwCfgSelectItem (FwCfgItem);\r
- QemuFwCfgReadBytes (FwCfgSize, Value);\r
-\r
- if ((FwCfgSize == 1) ||\r
- (FwCfgSize == 2 && Value[1] == '\n') ||\r
- (FwCfgSize == 3 && Value[1] == '\r' && Value[2] == '\n')) {\r
- switch (Value[0]) {\r
- case '0':\r
- case 'n':\r
- case 'N':\r
- *Setting = FALSE;\r
- return EFI_SUCCESS;\r
-\r
- case '1':\r
- case 'y':\r
- case 'Y':\r
- *Setting = TRUE;\r
- return EFI_SUCCESS;\r
-\r
- default:\r
- break;\r
- }\r
- }\r
- return EFI_PROTOCOL_ERROR;\r
-}\r
-\r
#define UPDATE_BOOLEAN_PCD_FROM_FW_CFG(TokenName) \\r
do { \\r
BOOLEAN Setting; \\r
RETURN_STATUS PcdStatus; \\r
\\r
- if (!EFI_ERROR (GetNamedFwCfgBoolean ( \\r
+ if (!RETURN_ERROR (QemuFwCfgParseBool ( \\r
"opt/ovmf/" #TokenName, &Setting))) { \\r
PcdStatus = PcdSetBoolS (TokenName, Setting); \\r
ASSERT_RETURN_ERROR (PcdStatus); \\r
VOID\r
)\r
{\r
- UPDATE_BOOLEAN_PCD_FROM_FW_CFG (PcdPropertiesTableEnable);\r
UPDATE_BOOLEAN_PCD_FROM_FW_CFG (PcdSetNxForStack);\r
}\r
\r
AcpiEnBit = ICH9_ACPI_CNTL_ACPI_EN;\r
break;\r
default:\r
- DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n",\r
+ DEBUG ((DEBUG_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n",\r
__FUNCTION__, mHostBridgeDevId));\r
ASSERT (FALSE);\r
return;\r
AllocateRuntimePages (\r
EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize))\r
);\r
- DEBUG ((EFI_D_INFO,\r
+ DEBUG ((DEBUG_INFO,\r
"Reserved variable store memory: 0x%lX; size: %dkb\n",\r
VariableStore,\r
(2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024\r
{\r
UINT32 Loop;\r
\r
- DEBUG ((EFI_D_INFO, "CMOS:\n"));\r
+ DEBUG ((DEBUG_INFO, "CMOS:\n"));\r
\r
for (Loop = 0; Loop < 0x80; Loop++) {\r
if ((Loop % 0x10) == 0) {\r
- DEBUG ((EFI_D_INFO, "%02x:", Loop));\r
+ DEBUG ((DEBUG_INFO, "%02x:", Loop));\r
}\r
- DEBUG ((EFI_D_INFO, " %02x", CmosRead8 (Loop)));\r
+ DEBUG ((DEBUG_INFO, " %02x", CmosRead8 (Loop)));\r
if ((Loop % 0x10) == 0xf) {\r
- DEBUG ((EFI_D_INFO, "\n"));\r
+ DEBUG ((DEBUG_INFO, "\n"));\r
}\r
}\r
}\r
{\r
#if defined (MDE_CPU_X64)\r
if (FeaturePcdGet (PcdSmmSmramRequire) && mS3Supported) {\r
- DEBUG ((EFI_D_ERROR,\r
+ DEBUG ((DEBUG_ERROR,\r
"%a: S3Resume2Pei doesn't support X64 PEI + SMM yet.\n", __FUNCTION__));\r
- DEBUG ((EFI_D_ERROR,\r
+ DEBUG ((DEBUG_ERROR,\r
"%a: Please disable S3 on the QEMU command line (see the README),\n",\r
__FUNCTION__));\r
- DEBUG ((EFI_D_ERROR,\r
+ DEBUG ((DEBUG_ERROR,\r
"%a: or build OVMF with \"OvmfPkgIa32X64.dsc\".\n", __FUNCTION__));\r
ASSERT (FALSE);\r
CpuDeadLoop ();\r
XenDetect ();\r
\r
if (QemuFwCfgS3Enabled ()) {\r
- DEBUG ((EFI_D_INFO, "S3 support was detected on QEMU\n"));\r
+ DEBUG ((DEBUG_INFO, "S3 support was detected on QEMU\n"));\r
mS3Supported = TRUE;\r
Status = PcdSetBoolS (PcdAcpiS3Enable, TRUE);\r
ASSERT_EFI_ERROR (Status);\r
if (FeaturePcdGet (PcdSmmSmramRequire)) {\r
Q35BoardVerification ();\r
Q35TsegMbytesInitialization ();\r
+ Q35SmramAtDefaultSmbaseInitialization ();\r
}\r
\r
PublishPeiMemory ();\r
InitializeRamRegions ();\r
\r
if (mXen) {\r
- DEBUG ((EFI_D_INFO, "Xen was detected\n"));\r
+ DEBUG ((DEBUG_INFO, "Xen was detected\n"));\r
InitializeXen ();\r
}\r
\r
ReserveEmuVariableNvStore ();\r
}\r
PeiFvInitialization ();\r
+ MemTypeInfoInitialization ();\r
MemMapInitialization ();\r
NoexecDxeInitialization ();\r
}\r