X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=IntelFrameworkModulePkg%2FUniversal%2FBdsDxe%2FBdsEntry.c;h=f89d8b8ebef1ca5951a0a27fa9cbaa6330baf950;hb=2b649f74775d0efd1e75c91f77c3045ae6249cb4;hp=d8bf26a7bb339f4c4b67aea794a39608b576fe9a;hpb=5c08e1173703234cc2913757f237ee916087498a;p=mirror_edk2.git diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c index d8bf26a7bb..f89d8b8ebe 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c @@ -1,12 +1,12 @@ /** @file - This module produce main entry for BDS phase - BdsEntry. + This module produce main entry for BDS phase - BdsEntry. When this module was dispatched by DxeCore, gEfiBdsArchProtocolGuid will be installed which contains interface of BdsEntry. After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked to enter BDS phase. -Copyright (c) 2004 - 2008, Intel Corporation.
-All rights reserved. This program and the accompanying materials +Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -27,17 +27,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /// /// Note: Current BDS not directly get the BootMode, DefaultBoot, /// TimeoutDefault, MemoryTestLevel value from the BDS arch protocol. -/// Please refer to the library useage of BdsLibGetBootMode, BdsLibGetTimeout +/// Please refer to the library useage of BdsLibGetBootMode, BdsLibGetTimeout /// and PlatformBdsDiagnostics in BdsPlatform.c /// -EFI_BDS_ARCH_PROTOCOL_INSTANCE gBdsInstanceTemplate = { - EFI_BDS_ARCH_PROTOCOL_INSTANCE_SIGNATURE, - NULL, - {BdsEntry}, - 0xFFFF, - TRUE, - 0, - EXTENSIVE +EFI_HANDLE gBdsHandle = NULL; + +EFI_BDS_ARCH_PROTOCOL gBds = { + BdsEntry }; UINT16 *mBootNext = NULL; @@ -70,11 +66,10 @@ BdsInitialize ( // // Install protocol interface // - Status = gBS->InstallProtocolInterface ( - &gBdsInstanceTemplate.Handle, - &gEfiBdsArchProtocolGuid, - EFI_NATIVE_INTERFACE, - &gBdsInstanceTemplate.Bds + Status = gBS->InstallMultipleProtocolInterfaces ( + &gBdsHandle, + &gEfiBdsArchProtocolGuid, &gBds, + NULL ); ASSERT_EFI_ERROR (Status); @@ -138,14 +133,14 @@ BdsBootDeviceSelect ( // UnicodeSPrint (Buffer, sizeof (Buffer), L"Boot%04x", *mBootNext); BootOption = BdsLibVariableToOption (&BootLists, Buffer); - + // // If fail to get boot option from variable, just return and do nothing. // if (BootOption == NULL) { return; } - + BootOption->BootCurrent = *mBootNext; } // @@ -196,7 +191,7 @@ BdsBootDeviceSelect ( // if (!IS_LOAD_OPTION_TYPE (BootOption->Attribute, LOAD_OPTION_ACTIVE)) { // - // skip the header of the link list, becuase it has no boot option + // skip the header of the link list, because it has no boot option // Link = Link->ForwardLink; continue; @@ -233,7 +228,7 @@ BdsBootDeviceSelect ( // // Call platform action to indicate the boot success // - BootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED)); + BootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED)); PlatformBdsBootSuccess (BootOption); // @@ -244,7 +239,7 @@ BdsBootDeviceSelect ( PlatformBdsEnterFrontPage (Timeout, FALSE); // - // Rescan the boot option list, avoid pertential risk of the boot + // Rescan the boot option list, avoid potential risk of the boot // option change in front page // if (BootNextExist) { @@ -280,16 +275,16 @@ BdsEntry ( IN EFI_BDS_ARCH_PROTOCOL *This ) { - EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData; LIST_ENTRY DriverOptionList; LIST_ENTRY BootOptionList; UINTN BootNextSize; + CHAR16 *FirmwareVendor; // // Insert the performance probe // - PERF_END (0, DXE_TOK, NULL, 0); - PERF_START (0, BDS_TOK, NULL, 0); + PERF_END (NULL, "DXE", NULL, 0); + PERF_START (NULL, "BDS", NULL, 0); // // Initialize the global system boot option and driver option @@ -303,19 +298,26 @@ BdsEntry ( InitializeHotkeyService (); // - // Get the BDS private data + // Fill in FirmwareVendor and FirmwareRevision from PCDs + // + FirmwareVendor = (CHAR16 *)PcdGetPtr (PcdFirmwareVendor); + gST->FirmwareVendor = AllocateRuntimeCopyPool (StrSize (FirmwareVendor), FirmwareVendor); + ASSERT (gST->FirmwareVendor != NULL); + gST->FirmwareRevision = PcdGet32 (PcdFirmwareRevision); + + // + // Fixup Tasble CRC after we updated Firmware Vendor and Revision // - PrivateData = EFI_BDS_ARCH_PROTOCOL_INSTANCE_FROM_THIS (This); + gBS->CalculateCrc32 ((VOID *)gST, sizeof(EFI_SYSTEM_TABLE), &gST->Hdr.CRC32); // // Do the platform init, can be customized by OEM/IBV // - PERF_START (0, "PlatformBds", "BDS", 0); - PlatformBdsInit (PrivateData); + PERF_START (NULL, "PlatformBds", "BDS", 0); + PlatformBdsInit (); + + InitializeHwErrRecSupport(); - if (FeaturePcdGet (PcdSupportHardwareErrorRecord)) { - InitializeHwErrRecSupport (PcdGet16 (PcdHardwareErrorRecordLevel)); - } // // bugbug: platform specific code // Initialize the platform specific string and language @@ -345,8 +347,8 @@ BdsEntry ( // // Setup some platform policy here // - PlatformBdsPolicyBehavior (PrivateData, &DriverOptionList, &BootOptionList); - PERF_END (0, "PlatformBds", "BDS", 0); + PlatformBdsPolicyBehavior (&DriverOptionList, &BootOptionList, BdsProcessCapsules, BdsMemoryTest); + PERF_END (NULL, "PlatformBds", "BDS", 0); // // BDS select the boot device to load OS