[edk2-devel] [PATCH v2 2/2] ArmVirtPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0
Philippe Mathieu-Daudé
philmd at redhat.com
Mon Oct 14 15:34:24 UTC 2019
On 10/14/19 5:03 PM, Pete Batard wrote:
> Similar to what we now do for OVMF, we need to consider the possibility
> that PlatformBootManagerWaitCallback () may be called with a
> PcdPlatformBootTimeOut that was set to zero, in which case the call should
> simply return.
Oh I forgot this one, good catch.
> We also change the initial timeout variable name to make the code explicit.
>
> Signed-off-by: Pete Batard <pete at akeo.ie>
> Reviewed-by: Laszlo Ersek <lersek at redhat.com>
> ---
> ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
> index 30c015eec5b0..5f6cfe64daca 100644
> --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -842,9 +842,17 @@ PlatformBootManagerWaitCallback (
> {
> EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black;
> EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White;
> - UINT16 Timeout;
> + UINT16 TimeoutInitial;
>
> - Timeout = PcdGet16 (PcdPlatformBootTimeOut);
> + TimeoutInitial = 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 +862,7 @@ PlatformBootManagerWaitCallback (
> Black.Pixel,
> L"Start boot option",
> White.Pixel,
> - (Timeout - TimeoutRemain) * 100 / Timeout,
> + (TimeoutInitial - TimeoutRemain) * 100 / TimeoutInitial,
> 0
> );
> }
>
Reviewed-by: Philippe Mathieu-Daude <philmd at redhat.com>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#48912): https://edk2.groups.io/g/devel/message/48912
Mute This Topic: https://groups.io/mt/34534296/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list