/** @file\r
- This module produce main entry for BDS phase - BdsEntry. \r
+ This module produce main entry for BDS phase - BdsEntry.\r
When this module was dispatched by DxeCore, gEfiBdsArchProtocolGuid will be installed\r
which contains interface of BdsEntry.\r
After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked\r
///\r
/// Note: Current BDS not directly get the BootMode, DefaultBoot,\r
/// TimeoutDefault, MemoryTestLevel value from the BDS arch protocol.\r
-/// Please refer to the library useage of BdsLibGetBootMode, BdsLibGetTimeout \r
+/// Please refer to the library useage of BdsLibGetBootMode, BdsLibGetTimeout\r
/// and PlatformBdsDiagnostics in BdsPlatform.c\r
///\r
-EFI_BDS_ARCH_PROTOCOL_INSTANCE gBdsInstanceTemplate = {\r
- EFI_BDS_ARCH_PROTOCOL_INSTANCE_SIGNATURE,\r
- NULL,\r
- {BdsEntry},\r
- 0xFFFF,\r
- TRUE,\r
- 0,\r
- EXTENSIVE\r
+EFI_HANDLE gBdsHandle = NULL;\r
+\r
+EFI_BDS_ARCH_PROTOCOL gBds = {\r
+ BdsEntry\r
};\r
\r
UINT16 *mBootNext = NULL;\r
//\r
// Install protocol interface\r
//\r
- Status = gBS->InstallProtocolInterface (\r
- &gBdsInstanceTemplate.Handle,\r
- &gEfiBdsArchProtocolGuid,\r
- EFI_NATIVE_INTERFACE,\r
- &gBdsInstanceTemplate.Bds\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &gBdsHandle,\r
+ &gEfiBdsArchProtocolGuid, &gBds,\r
+ NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
//\r
UnicodeSPrint (Buffer, sizeof (Buffer), L"Boot%04x", *mBootNext);\r
BootOption = BdsLibVariableToOption (&BootLists, Buffer);\r
- \r
+\r
//\r
// If fail to get boot option from variable, just return and do nothing.\r
//\r
if (BootOption == NULL) {\r
return;\r
}\r
- \r
+\r
BootOption->BootCurrent = *mBootNext;\r
}\r
//\r
//\r
// Call platform action to indicate the boot success\r
//\r
- BootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED)); \r
+ BootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));\r
PlatformBdsBootSuccess (BootOption);\r
\r
//\r
IN EFI_BDS_ARCH_PROTOCOL *This\r
)\r
{\r
- EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData;\r
LIST_ENTRY DriverOptionList;\r
LIST_ENTRY BootOptionList;\r
UINTN BootNextSize;\r
+ CHAR16 *FirmwareVendor;\r
\r
//\r
// Insert the performance probe\r
//\r
- PERF_END (0, "DXE", NULL, 0);\r
- PERF_START (0, "BDS", NULL, 0);\r
+ PERF_END (NULL, "DXE", NULL, 0);\r
+ PERF_START (NULL, "BDS", NULL, 0);\r
\r
//\r
// Initialize the global system boot option and driver option\r
InitializeHotkeyService ();\r
\r
//\r
- // Get the BDS private data\r
+ // Fill in FirmwareVendor and FirmwareRevision from PCDs\r
+ //\r
+ FirmwareVendor = (CHAR16 *)PcdGetPtr (PcdFirmwareVendor);\r
+ gST->FirmwareVendor = AllocateRuntimeCopyPool (StrSize (FirmwareVendor), FirmwareVendor);\r
+ ASSERT (gST->FirmwareVendor != NULL);\r
+ gST->FirmwareRevision = PcdGet32 (PcdFirmwareRevision);\r
+\r
+ //\r
+ // Fixup Tasble CRC after we updated Firmware Vendor and Revision\r
//\r
- PrivateData = EFI_BDS_ARCH_PROTOCOL_INSTANCE_FROM_THIS (This);\r
+ gBS->CalculateCrc32 ((VOID *)gST, sizeof(EFI_SYSTEM_TABLE), &gST->Hdr.CRC32);\r
\r
//\r
// Do the platform init, can be customized by OEM/IBV\r
//\r
- PERF_START (0, "PlatformBds", "BDS", 0);\r
- PlatformBdsInit (PrivateData);\r
+ PERF_START (NULL, "PlatformBds", "BDS", 0);\r
+ PlatformBdsInit ();\r
+\r
+ InitializeHwErrRecSupport();\r
\r
- if (FeaturePcdGet (PcdSupportHardwareErrorRecord)) {\r
- InitializeHwErrRecSupport (PcdGet16 (PcdHardwareErrorRecordLevel));\r
- }\r
//\r
// bugbug: platform specific code\r
// Initialize the platform specific string and language\r
//\r
// Setup some platform policy here\r
//\r
- PlatformBdsPolicyBehavior (PrivateData, &DriverOptionList, &BootOptionList);\r
- PERF_END (0, "PlatformBds", "BDS", 0);\r
+ PlatformBdsPolicyBehavior (&DriverOptionList, &BootOptionList, BdsProcessCapsules, BdsMemoryTest);\r
+ PERF_END (NULL, "PlatformBds", "BDS", 0);\r
\r
//\r
// BDS select the boot device to load OS\r