X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Nt32Pkg%2FLibrary%2FNt32BdsLib%2FBdsPlatform.c;h=edfcbcfd584f92f078503fa88f72fb7328ee72fa;hb=60f3d321cedf231434ba5bea70ac5cc634776363;hp=3c981fb21a52ce35ef685e2ae5e0756f51cdae83;hpb=fcf24bad4a7b0e7acb540caaa618f53547033d85;p=mirror_edk2.git diff --git a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c index 3c981fb21a..edfcbcfd58 100644 --- a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c +++ b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c @@ -22,7 +22,6 @@ Abstract: #include "BdsPlatform.h" -CHAR16 mFirmwareVendor[] = L"TianoCore.org"; WIN_NT_SYSTEM_CONFIGURATION mSystemConfigData; VOID @@ -66,8 +65,9 @@ SetupVariableInit ( // BDS Platform Functions // VOID +EFIAPI PlatformBdsInit ( - IN EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData + VOID ) /*++ @@ -78,30 +78,12 @@ Routine Description: 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); - SetupVariableInit (); } @@ -253,7 +235,8 @@ Returns: VOID PlatformBdsDiagnostics ( IN EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel, - IN BOOLEAN QuietBoot + IN BOOLEAN QuietBoot, + IN BASEM_MEMORY_TEST BaseMemoryTest ) /*++ @@ -267,7 +250,9 @@ Arguments: MemoryTestLevel - The memory test intensive level QuietBoot - Indicate if need to enable the quiet boot - + + BaseMemoryTest - A pointer to BdsMemoryTest() + Returns: None. @@ -283,11 +268,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 (); } @@ -297,44 +282,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 @@ -344,13 +322,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: @@ -359,7 +337,7 @@ Returns: // console directly. // BdsLibConnectAllDefaultConsoles (); - PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE); + PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE, BaseMemoryTest); // // Perform some platform specific connect sequence @@ -383,7 +361,7 @@ Returns: // Boot with the specific configuration // PlatformBdsConnectConsole (gPlatformConsole); - PlatformBdsDiagnostics (EXTENSIVE, FALSE); + PlatformBdsDiagnostics (EXTENSIVE, FALSE, BaseMemoryTest); BdsLibConnectAll (); ProcessCapsules (BOOT_ON_FLASH_UPDATE); break; @@ -394,7 +372,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 @@ -418,7 +396,7 @@ Returns: PlatformBdsNoConsoleAction (); } - PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE); + PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE, BaseMemoryTest); // // Perform some platform specific connect sequence @@ -443,6 +421,7 @@ Returns: } VOID +EFIAPI PlatformBdsBootSuccess ( IN BDS_COMMON_OPTION *Option ) @@ -479,6 +458,7 @@ Returns: } VOID +EFIAPI PlatformBdsBootFail ( IN BDS_COMMON_OPTION *Option, IN EFI_STATUS Status, @@ -545,11 +525,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; }