X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=DuetPkg%2FLibrary%2FDuetBdsLib%2FBdsPlatform.c;h=1875dc963680c0fff3e397a16e9004a9008f6197;hp=acf6abb0737a916277a4e253d0cf5d9634c8d8ad;hb=c687b1464bb42a3c2d3eb2935ddd09752c6d2f2a;hpb=951d3095d8f1bea828b1dbb07c053ce124f9a369 diff --git a/DuetPkg/Library/DuetBdsLib/BdsPlatform.c b/DuetPkg/Library/DuetBdsLib/BdsPlatform.c index acf6abb073..1875dc9636 100644 --- a/DuetPkg/Library/DuetBdsLib/BdsPlatform.c +++ b/DuetPkg/Library/DuetBdsLib/BdsPlatform.c @@ -1,7 +1,7 @@ /*++ -Copyright (c) 2006 - 2008, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2014, 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 @@ -83,21 +83,6 @@ Returns: return ; } -#define EFI_LDR_MEMORY_DESCRIPTOR_GUID \ - { 0x7701d7e5, 0x7d1d, 0x4432, {0xa4, 0x68, 0x67, 0x3d, 0xab, 0x8a, 0xde, 0x60 }} - -EFI_GUID gEfiLdrMemoryDescriptorGuid = EFI_LDR_MEMORY_DESCRIPTOR_GUID; - -#pragma pack(1) - -typedef struct { - EFI_HOB_GUID_TYPE Hob; - UINTN MemDescCount; - EFI_MEMORY_DESCRIPTOR *MemDesc; -} MEMORY_DESC_HOB; - -#pragma pack() - #if 0 VOID PrintMemoryMap ( @@ -153,12 +138,8 @@ UpdateMemoryMap ( UINTN Index; EFI_PHYSICAL_ADDRESS Memory; EFI_GCD_MEMORY_SPACE_DESCRIPTOR Descriptor; - // - // Get Hob List - // - GuidHob.Raw = GetHobList(); - GuidHob.Raw = GetNextGuidHob (&gEfiLdrMemoryDescriptorGuid, GuidHob.Raw); + GuidHob.Raw = GetFirstGuidHob (&gLdrMemoryDescriptorGuid); if (GuidHob.Raw == NULL) { DEBUG ((EFI_D_ERROR, "Fail to get gEfiLdrMemoryDescriptorGuid from GUID HOB LIST!\n")); return; @@ -336,13 +317,13 @@ Returns: if (!EFI_ERROR (Status)) { if ((PCI_CLASS_SERIAL == Class[2]) && (PCI_CLASS_SERIAL_USB == Class[1])) { - if (PCI_CLASSC_PI_UHCI == Class[0]) { + if (PCI_IF_UHCI == Class[0]) { // // Found the UHCI, then disable the legacy support // Command = 0; Status = PciIo->Pci.Write (PciIo, EfiPciIoWidthUint16, 0xC0, 1, &Command); - } else if (PCI_CLASSC_PI_EHCI == Class[0]) { + } else if (PCI_IF_EHCI == Class[0]) { // // Found the EHCI, then disable the legacy support // @@ -740,7 +721,8 @@ Returns: EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; - DevicePath = NULL; + DevicePath = NULL; + GopDevicePath = NULL; Status = gBS->HandleProtocol ( DeviceHandle, &gEfiDevicePathProtocolGuid, @@ -1092,7 +1074,8 @@ Returns: VOID PlatformBdsDiagnostics ( IN EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel, - IN BOOLEAN QuietBoot + IN BOOLEAN QuietBoot, + IN BASEM_MEMORY_TEST BaseMemoryTest ) /*++ @@ -1106,6 +1089,8 @@ Arguments: MemoryTestLevel - The memory test intensive level QuietBoot - Indicate if need to enable the quiet boot + + BaseMemoryTest - A pointer to BdsMemoryTest() Returns: @@ -1131,7 +1116,7 @@ Returns: // // Perform system diagnostic // - Status = BdsMemoryTest (MemoryTestLevel); + Status = BaseMemoryTest (MemoryTestLevel); if (EFI_ERROR (Status)) { DisableQuietBoot (); } @@ -1141,14 +1126,16 @@ Returns: // // Perform system diagnostic // - Status = BdsMemoryTest (MemoryTestLevel); + Status = BaseMemoryTest (MemoryTestLevel); } VOID EFIAPI PlatformBdsPolicyBehavior ( IN OUT LIST_ENTRY *DriverOptionList, - IN OUT LIST_ENTRY *BootOptionList + IN OUT LIST_ENTRY *BootOptionList, + IN PROCESS_CAPSULES ProcessCapsules, + IN BASEM_MEMORY_TEST BaseMemoryTest ) /*++ @@ -1173,11 +1160,8 @@ Returns: EFI_STATUS Status; UINT16 Timeout; EFI_EVENT UserInputDurationTime; - LIST_ENTRY *Link; - BDS_COMMON_OPTION *BootOption; UINTN Index; EFI_INPUT_KEY Key; - EFI_TPL OldTpl; EFI_BOOT_MODE BootMode; // @@ -1227,7 +1211,7 @@ Returns: // // Memory test and Logo show // - PlatformBdsDiagnostics (IGNORE, TRUE); + PlatformBdsDiagnostics (IGNORE, TRUE, BaseMemoryTest); // // Perform some platform specific connect sequence @@ -1270,36 +1254,11 @@ Returns: // // To give the User a chance to enter Setup here, if user set TimeOut is 0. // BDS should still give user a chance to enter Setup - // - // Connect first boot option, and then check user input before exit - // - for (Link = BootOptionList->ForwardLink; Link != BootOptionList;Link = Link->ForwardLink) { - BootOption = CR (Link, BDS_COMMON_OPTION, Link, BDS_LOAD_OPTION_SIGNATURE); - if (!IS_LOAD_OPTION_TYPE (BootOption->Attribute, LOAD_OPTION_ACTIVE)) { - // - // skip the header of the link list, becuase it has no boot option - // - continue; - } else { - // - // Make sure the boot option device path connected, but ignore the BBS device path - // - if (DevicePathType (BootOption->DevicePath) != BBS_DEVICE_PATH) { - BdsLibConnectDevicePath (BootOption->DevicePath); - } - break; - } - } - - // // Check whether the user input after the duration time has expired // - OldTpl = EfiGetCurrentTpl(); - gBS->RestoreTPL (TPL_APPLICATION); gBS->WaitForEvent (1, &UserInputDurationTime, &Index); gBS->CloseEvent (UserInputDurationTime); Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); - gBS->RaiseTPL (OldTpl); if (!EFI_ERROR (Status)) { // @@ -1736,3 +1695,37 @@ Returns: return EFI_SUCCESS; } + +/** + Lock the ConsoleIn device in system table. All key + presses will be ignored until the Password is typed in. The only way to + disable the password is to type it in to a ConIn device. + + @param Password Password used to lock ConIn device. + + @retval EFI_SUCCESS lock the Console In Spliter virtual handle successfully. + @retval EFI_UNSUPPORTED Password not found + +**/ +EFI_STATUS +EFIAPI +LockKeyboards ( + IN CHAR16 *Password + ) +{ + return EFI_UNSUPPORTED; +} + +/** + This function locks platform flash that is not allowed to be updated during normal boot path. + The flash layout is platform specific. + + **/ +VOID +EFIAPI +PlatformBdsLockNonUpdatableFlash ( + VOID + ) +{ + return; +}