X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Nt32Pkg%2FLibrary%2FNt32BdsLib%2FBdsPlatform.c;h=0055223d8310d0d70d417981b6fa5be20ee9a6a7;hb=8e01b449de91cfcd1bdf473ae1bc766c22eb616e;hp=6970ceb0080f4ea8b37fcb6090a11471404c2066;hpb=519f076a478a7da9ff4b9d5327a993b1fc2968e8;p=mirror_edk2.git diff --git a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c index 6970ceb008..0055223d83 100644 --- a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c +++ b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c @@ -1,7 +1,7 @@ /**@file -Copyright (c) 2004 - 2006, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2004 - 2006, 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 @@ -22,48 +22,70 @@ Abstract: #include "BdsPlatform.h" -CHAR16 mFirmwareVendor[] = L"TianoCore.org"; +WIN_NT_SYSTEM_CONFIGURATION mSystemConfigData; + +VOID +SetupVariableInit ( + VOID + ) +{ + EFI_STATUS Status; + UINTN Size; + + Size = sizeof (mSystemConfigData); + Status = gRT->GetVariable ( + L"Setup", + &gEfiWinNtSystemConfigGuid, + NULL, + &Size, + (VOID *) &mSystemConfigData + ); + + if (EFI_ERROR (Status)) { + // + // SetupVariable is corrupt + // + mSystemConfigData.ConOutRow = PcdGet32 (PcdConOutColumn); + mSystemConfigData.ConOutColumn = PcdGet32 (PcdConOutRow); + + Status = gRT->SetVariable ( + L"Setup", + &gEfiWinNtSystemConfigGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, + sizeof (mSystemConfigData), + (VOID *) &mSystemConfigData + ); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "Failed to save Setup Variable to non-volatile storage, Status = %r\n", Status)); + } + } +} // // BDS Platform Functions // VOID +EFIAPI PlatformBdsInit ( - IN EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData + VOID ) /*++ Routine Description: - Platform Bds init. Incude the platform firmware vendor, revision + Platform Bds init. Include the platform firmware vendor, revision and so crc check. Arguments: - PrivateData - The EFI_BDS_ARCH_PROTOCOL_INSTANCE instance - Returns: None. --*/ { - // - // set firmwarevendor, here can be IBV/OEM customize - // - gST->FirmwareVendor = AllocateRuntimeCopyPool ( - sizeof (mFirmwareVendor), - &mFirmwareVendor - ); - ASSERT (gST->FirmwareVendor != NULL); - - gST->FirmwareRevision = 0; - - // - // Fixup Tasble CRC after we updated Firmware Vendor and Revision - // - gBS->CalculateCrc32 ((VOID *) gST, sizeof (EFI_SYSTEM_TABLE), &gST->Hdr.CRC32); - + BdsLibSaveMemoryTypeInformation (); + SetupVariableInit (); } EFI_STATUS @@ -214,7 +236,8 @@ Returns: VOID PlatformBdsDiagnostics ( IN EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel, - IN BOOLEAN QuietBoot + IN BOOLEAN QuietBoot, + IN BASEM_MEMORY_TEST BaseMemoryTest ) /*++ @@ -228,7 +251,9 @@ Arguments: MemoryTestLevel - The memory test intensive level QuietBoot - Indicate if need to enable the quiet boot - + + BaseMemoryTest - A pointer to BdsMemoryTest() + Returns: None. @@ -244,11 +269,11 @@ Returns: // from the graphic lib // if (QuietBoot) { - EnableQuietBoot (&gEfiDefaultBmpLogoGuid); + EnableQuietBoot (PcdGetPtr(PcdLogoFile)); // // Perform system diagnostic // - Status = BdsMemoryTest (MemoryTestLevel); + Status = BaseMemoryTest (MemoryTestLevel); if (EFI_ERROR (Status)) { DisableQuietBoot (); } @@ -258,44 +283,37 @@ Returns: // // Perform system diagnostic // - Status = BdsMemoryTest (MemoryTestLevel); + Status = BaseMemoryTest (MemoryTestLevel); } -VOID -PlatformBdsPolicyBehavior ( - IN EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData, - IN OUT LIST_ENTRY *DriverOptionList, - IN OUT LIST_ENTRY *BootOptionList - ) -/*++ - -Routine Description: - +/** The function will excute with as the platform policy, current policy is driven by boot mode. IBV/OEM can customize this code for their specific policy action. - -Arguments: - PrivateData - The EFI_BDS_ARCH_PROTOCOL_INSTANCE instance - - DriverOptionList - The header of the driver option link list - - BootOptionList - The header of the boot option link list - -Returns: + @param DriverOptionList The header of the driver option link list + @param BootOptionList The header of the boot option link list + @param ProcessCapsules A pointer to ProcessCapsules() + @param BaseMemoryTest A pointer to BaseMemoryTest() - None. - ---*/ +**/ +VOID +EFIAPI +PlatformBdsPolicyBehavior ( + IN OUT LIST_ENTRY *DriverOptionList, + IN OUT LIST_ENTRY *BootOptionList, + IN PROCESS_CAPSULES ProcessCapsules, + IN BASEM_MEMORY_TEST BaseMemoryTest + ) { - EFI_STATUS Status; - UINT16 Timeout; + EFI_STATUS Status; + UINT16 Timeout; + EFI_BOOT_MODE BootMode; // // Init the time out value // - Timeout = BdsLibGetTimeout (); + Timeout = PcdGet16 (PcdPlatformBootTimeOut); // // Load the driver option as the driver option list @@ -305,13 +323,13 @@ Returns: // // Get current Boot Mode // - Status = BdsLibGetBootMode (&PrivateData->BootMode); + Status = BdsLibGetBootMode (&BootMode); // // Go the different platform policy with different boot mode // Notes: this part code can be change with the table policy // - switch (PrivateData->BootMode) { + switch (BootMode) { case BOOT_ASSUMING_NO_CONFIGURATION_CHANGES: case BOOT_WITH_MINIMAL_CONFIGURATION: @@ -320,7 +338,7 @@ Returns: // console directly. // BdsLibConnectAllDefaultConsoles (); - PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE); + PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE, BaseMemoryTest); // // Perform some platform specific connect sequence @@ -344,7 +362,7 @@ Returns: // Boot with the specific configuration // PlatformBdsConnectConsole (gPlatformConsole); - PlatformBdsDiagnostics (EXTENSIVE, FALSE); + PlatformBdsDiagnostics (EXTENSIVE, FALSE, BaseMemoryTest); BdsLibConnectAll (); ProcessCapsules (BOOT_ON_FLASH_UPDATE); break; @@ -355,7 +373,7 @@ Returns: // and show up the front page // PlatformBdsConnectConsole (gPlatformConsole); - PlatformBdsDiagnostics (EXTENSIVE, FALSE); + PlatformBdsDiagnostics (EXTENSIVE, FALSE, BaseMemoryTest); // // In recovery boot mode, we still enter to the @@ -379,7 +397,7 @@ Returns: PlatformBdsNoConsoleAction (); } - PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE); + PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE, BaseMemoryTest); // // Perform some platform specific connect sequence @@ -404,6 +422,7 @@ Returns: } VOID +EFIAPI PlatformBdsBootSuccess ( IN BDS_COMMON_OPTION *Option ) @@ -440,6 +459,7 @@ Returns: } VOID +EFIAPI PlatformBdsBootFail ( IN BDS_COMMON_OPTION *Option, IN EFI_STATUS Status, @@ -506,11 +526,36 @@ Returns: return EFI_SUCCESS; } -EFI_STATUS +/** + 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 EFI_SUCCESS; + return; +} + +/** + 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; }