\r
--*/\r
{\r
- EFI_STATUS Status;\r
- EFI_HOB_HANDOFF_INFO_TABLE *HobList;\r
- EFI_HOB_HANDOFF_INFO_TABLE *HobStart;\r
+ EFI_PEI_HOB_POINTERS GuidHob;\r
+ EFI_PEI_HOB_POINTERS HobStart;\r
EFI_PHYSICAL_ADDRESS *Table;\r
UINTN Index;\r
EFI_GUID *TableGuidArray[] = {\r
//\r
// Get Hob List\r
//\r
- Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, (VOID *) &HobList);\r
- if (EFI_ERROR (Status)) {\r
- return;\r
- }\r
-\r
+ HobStart.Raw = GetHobList ();\r
//\r
// Iteratively add ACPI Table, SMBIOS Table, MPS Table to EFI System Table\r
//\r
for (Index = 0; Index < sizeof (TableGuidArray) / sizeof (*TableGuidArray); ++Index) {\r
- HobStart = HobList;\r
- Table = NULL;\r
- Table = GetNextGuidHob (TableGuidArray[Index], &HobStart);\r
- if (!EFI_ERROR (Status)) {\r
+ GuidHob.Raw = GetNextGuidHob (TableGuidArray[Index], HobStart.Raw);\r
+ if (GuidHob.Raw != NULL) {\r
+ Table = GET_GUID_HOB_DATA (GuidHob.Guid);\r
if (Table != NULL) {\r
//\r
// Check if Mps Table/Smbios Table/Acpi Table exists in E/F seg,\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_HOB_HANDOFF_INFO_TABLE *HobList;\r
+ EFI_PEI_HOB_POINTERS GuidHob;\r
VOID *Table;\r
MEMORY_DESC_HOB MemoryDescHob;\r
UINTN Index;\r
//\r
// Get Hob List\r
//\r
- Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, (VOID *) &HobList);\r
- if (EFI_ERROR (Status)) {\r
+ GuidHob.Raw = GetHobList();\r
+ \r
+ GuidHob.Raw = GetNextGuidHob (&gEfiLdrMemoryDescriptorGuid, GuidHob.Raw);\r
+ if (GuidHob.Raw == NULL) {\r
+ DEBUG ((EFI_D_ERROR, "Fail to get gEfiLdrMemoryDescriptorGuid from GUID HOB LIST!\n"));\r
+ return;\r
+ }\r
+ Table = GET_GUID_HOB_DATA (GuidHob.Guid);\r
+ if (Table == NULL) {\r
+ DEBUG ((EFI_D_ERROR, "Fail to get gEfiLdrMemoryDescriptorGuid from GUID HOB LIST!\n"));\r
return;\r
}\r
-\r
- Table = GetNextGuidHob (&gEfiLdrMemoryDescriptorGuid, &HobList);\r
MemoryDescHob.MemDescCount = *(UINTN *)Table;\r
MemoryDescHob.MemDesc = *(EFI_MEMORY_DESCRIPTOR **)((UINTN)Table + sizeof(UINTN));\r
\r
// Fixup Tasble CRC after we updated Firmware Vendor and Revision\r
//\r
gBS->CalculateCrc32 ((VOID *) gST, sizeof (EFI_SYSTEM_TABLE), &gST->Hdr.CRC32);\r
+\r
+ GetSystemTablesFromHob ();\r
+\r
+ UpdateMemoryMap ();\r
+ \r
+ //\r
+ // Append Usb Keyboard short form DevicePath into "ConInDev" \r
+ //\r
+ BdsLibUpdateConsoleVariable (\r
+ VarConsoleInpDev,\r
+ (EFI_DEVICE_PATH_PROTOCOL *) &gUsbClassKeyboardDevicePath,\r
+ NULL\r
+ );\r
}\r
\r
UINT64\r
UINTN BufferSize;\r
UINT32 Index;\r
UINT32 Number;\r
- VOID *HobList;\r
- EFI_STATUS Status;\r
+ EFI_PEI_HOB_POINTERS GuidHob;\r
\r
BufferSize = 0;\r
//\r
// Get Hob List from configuration table\r
//\r
- Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, &HobList);\r
- if (EFI_ERROR (Status)) {\r
- return 0;\r
- }\r
+ GuidHob.Raw = GetHobList ();\r
\r
//\r
// Get PciExpressAddressInfo Hob\r
//\r
- PciExpressBaseAddressInfo = NULL;\r
- PciExpressBaseAddressInfo = GetNextGuidHob (&gEfiPciExpressBaseAddressGuid, &HobList);\r
+ GuidHob.Raw = GetNextGuidHob (&gEfiPciExpressBaseAddressGuid, GuidHob.Raw);\r
+ if (GuidHob.Raw == NULL) {\r
+ DEBUG ((EFI_D_ERROR, "Fail to get gEfiPciExpressBaseAddressGuid from GUID HOB\n"));\r
+ return 0;\r
+ }\r
+ PciExpressBaseAddressInfo = (EFI_PCI_EXPRESS_BASE_ADDRESS_INFORMATION *) GET_GUID_HOB_DATA (GuidHob.Guid);\r
+ if (PciExpressBaseAddressInfo == NULL) {\r
+ DEBUG ((EFI_D_ERROR, "Fail to get gEfiPciExpressBaseAddressGuid from GUID HOB\n"));\r
+ return 0;\r
+ }\r
\r
//\r
// Search the PciExpress Base Address in the Hob for current RootBridge\r
return EFI_SUCCESS;\r
}\r
\r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
EFI_STATUS\r
GetGopDevicePath (\r
IN EFI_DEVICE_PATH_PROTOCOL *PciDevicePath,\r
\r
return EFI_SUCCESS;\r
}\r
-#endif\r
\r
EFI_STATUS\r
PreparePciVgaDevicePath (\r
{\r
EFI_STATUS Status;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
EFI_DEVICE_PATH_PROTOCOL *GopDevicePath;\r
-#endif \r
\r
DevicePath = NULL;\r
Status = gBS->HandleProtocol (\r
return Status;\r
}\r
\r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
GetGopDevicePath (DevicePath, &GopDevicePath);\r
DevicePath = GopDevicePath;\r
-#endif\r
\r
BdsLibUpdateConsoleVariable (VarConsoleOut, DevicePath, NULL);\r
\r
// Add IsaKeyboard to ConIn,\r
// add IsaSerial to ConOut, ConIn, ErrOut\r
//\r
+ DEBUG ((EFI_D_INFO, "Find the LPC Bridge device\n"));\r
PrepareLpcBridgeDevicePath (HandleBuffer[Index]);\r
continue;\r
}\r
//\r
// Add them to ConOut, ConIn, ErrOut.\r
//\r
+ DEBUG ((EFI_D_INFO, "Find the 16550 SERIAL device\n"));\r
PreparePciSerialDevicePath (HandleBuffer[Index]);\r
continue;\r
}\r
//\r
// Add them to ConOut.\r
//\r
+ DEBUG ((EFI_D_INFO, "Find the VGA device\n"));\r
PreparePciVgaDevicePath (HandleBuffer[Index]);\r
continue;\r
}\r
// from the graphic lib\r
//\r
if (QuietBoot) {\r
- EnableQuietBootEx (&gEfiDefaultBmpLogoGuid, mBdsImageHandle);\r
+ Status = EnableQuietBootEx (&gEfiDefaultBmpLogoGuid, mBdsImageHandle);\r
+ if (EFI_ERROR (Status)) {\r
+ DisableQuietBoot ();\r
+ return;\r
+ }\r
+\r
//\r
// Perform system diagnostic\r
//\r
//\r
// Check whether the user input after the duration time has expired \r
//\r
- OldTpl = BdsLibGetCurrentTpl();\r
+ OldTpl = EfiGetCurrentTpl();\r
gBS->RestoreTPL (TPL_APPLICATION); \r
gBS->WaitForEvent (1, &UserInputDurationTime, &Index);\r
gBS->CloseEvent (UserInputDurationTime);\r