]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0
authorPete Batard <pete@akeo.ie>
Mon, 14 Oct 2019 15:03:11 +0000 (16:03 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Wed, 16 Oct 2019 16:27:42 +0000 (18:27 +0200)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2266

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.

We also change the initial timeout variable name to make the code explicit.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20191014150311.16740-3-pete@akeo.ie>

ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c

index 30c015eec5b0ad86af7bec93636f4d04c8551148..5f6cfe64daca131d31fabe5249c78cf768ee0509 100644 (file)
@@ -842,9 +842,17 @@ PlatformBootManagerWaitCallback (
 {\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black;\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White;\r
-  UINT16                              Timeout;\r
+  UINT16                              TimeoutInitial;\r
 \r
-  Timeout = PcdGet16 (PcdPlatformBootTimeOut);\r
+  TimeoutInitial = PcdGet16 (PcdPlatformBootTimeOut);\r
+\r
+  //\r
+  // If PcdPlatformBootTimeOut is set to zero, then we consider\r
+  // that no progress update should be enacted.\r
+  //\r
+  if (TimeoutInitial == 0) {\r
+    return;\r
+  }\r
 \r
   Black.Raw = 0x00000000;\r
   White.Raw = 0x00FFFFFF;\r
@@ -854,7 +862,7 @@ PlatformBootManagerWaitCallback (
     Black.Pixel,\r
     L"Start boot option",\r
     White.Pixel,\r
-    (Timeout - TimeoutRemain) * 100 / Timeout,\r
+    (TimeoutInitial - TimeoutRemain) * 100 / TimeoutInitial,\r
     0\r
     );\r
 }\r