X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ArmVirtPkg%2FLibrary%2FPlatformBootManagerLib%2FPlatformBm.c;h=69448ff65bde5bd98d970965d824c9f14a3c6161;hb=7288ff4095cf4254dd2f86ad97c648d9e6114fc8;hp=30c015eec5b0ad86af7bec93636f4d04c8551148;hpb=4ff31c083e239df00fc6e04c2efcc896d500a90d;p=mirror_edk2.git diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c index 30c015eec5..69448ff65b 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -686,7 +687,9 @@ PlatformBootManagerBeforeConsole ( VOID ) { + UINT16 FrontPageTimeout; RETURN_STATUS PcdStatus; + EFI_STATUS Status; // // Signal EndOfDxe PI Event @@ -744,9 +747,29 @@ PlatformBootManagerBeforeConsole ( // // Set the front page timeout from the QEMU configuration. // - PcdStatus = PcdSet16S (PcdPlatformBootTimeOut, - GetFrontPageTimeoutFromQemu ()); + FrontPageTimeout = GetFrontPageTimeoutFromQemu (); + PcdStatus = PcdSet16S (PcdPlatformBootTimeOut, FrontPageTimeout); ASSERT_RETURN_ERROR (PcdStatus); + // + // Reflect the PCD in the standard Timeout variable. + // + Status = gRT->SetVariable ( + EFI_TIME_OUT_VARIABLE_NAME, + &gEfiGlobalVariableGuid, + (EFI_VARIABLE_NON_VOLATILE | + EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS), + sizeof FrontPageTimeout, + &FrontPageTimeout + ); + DEBUG (( + EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE, + "%a: SetVariable(%s, %u): %r\n", + __FUNCTION__, + EFI_TIME_OUT_VARIABLE_NAME, + FrontPageTimeout, + Status + )); // // Register platform-specific boot options and keyboard shortcuts. @@ -842,9 +865,17 @@ PlatformBootManagerWaitCallback ( { EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black; EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White; - UINT16 Timeout; + UINT16 TimeoutInitial; + + TimeoutInitial = PcdGet16 (PcdPlatformBootTimeOut); - Timeout = PcdGet16 (PcdPlatformBootTimeOut); + // + // If PcdPlatformBootTimeOut is set to zero, then we consider + // that no progress update should be enacted. + // + if (TimeoutInitial == 0) { + return; + } Black.Raw = 0x00000000; White.Raw = 0x00FFFFFF; @@ -854,7 +885,7 @@ PlatformBootManagerWaitCallback ( Black.Pixel, L"Start boot option", White.Pixel, - (Timeout - TimeoutRemain) * 100 / Timeout, + (TimeoutInitial - TimeoutRemain) * 100 / TimeoutInitial, 0 ); }