]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/BdsDxe: Fix calling PlatformBootManagerWaitCallback on 0
authorLaszlo Ersek <lersek@redhat.com>
Fri, 11 Oct 2019 15:43:37 +0000 (23:43 +0800)
committerLiming Gao <liming.gao@intel.com>
Tue, 15 Oct 2019 00:02:17 +0000 (08:02 +0800)
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2266

Commit 2de1f611be06ded3a59726a4052a9039be7d459b introduced a regression
whereas platforms that did set PcdPlatformBootTimeOut to 0 are now getting
an unexpected call to PlatformBootManagerWaitCallback().

This patch also ensures that, if PcdPlatformBootTimeOut is 0xFFFF we don't
call PlatformBootManagerWaitCallback() with a zero argument as doing so
would produce an unwarranted jump to full progress completion which is
likely to throw off users.

Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdeModulePkg/Universal/BdsDxe/BdsEntry.c

index 7968a58f3454dd6a19c9dac049ea4cbc7e7a08e8..d6ec31118c1ffd87e37fb0a6430a98b97ddbd1c4 100644 (file)
@@ -341,7 +341,17 @@ BdsWait (
       TimeoutRemain--;\r
     }\r
   }\r
-  PlatformBootManagerWaitCallback (0);\r
+\r
+  //\r
+  // If the platform configured a nonzero and finite time-out, and we have\r
+  // actually reached that, report 100% completion to the platform.\r
+  //\r
+  // Note that the (TimeoutRemain == 0) condition excludes\r
+  // PcdPlatformBootTimeOut=0xFFFF, and that's deliberate.\r
+  //\r
+  if (PcdGet16 (PcdPlatformBootTimeOut) != 0 && TimeoutRemain == 0) {\r
+    PlatformBootManagerWaitCallback (0);\r
+  }\r
   DEBUG ((EFI_D_INFO, "[Bds]Exit the waiting!\n"));\r
 }\r
 \r