diff options
author | Eric Dong <eric.dong@intel.com> | 2014-11-06 08:56:54 +0000 |
---|---|---|
committer | ydong10 <ydong10@Edk2> | 2014-11-06 08:56:54 +0000 |
commit | e0763f87575cbd58bc38c4220e59010265a620e1 (patch) | |
tree | 46479bfc5fb66db0b1ecece5ab53a561ebdd7494 | |
parent | 8fd82c235df3b473c1572081a2b8bb00273bd2d6 (diff) | |
download | edk2-e0763f87575cbd58bc38c4220e59010265a620e1.zip edk2-e0763f87575cbd58bc38c4220e59010265a620e1.tar.gz edk2-e0763f87575cbd58bc38c4220e59010265a620e1.tar.bz2 |
Try to read key strike even when the TimeOuts value is zero, this will avoid BDS not get user input when TimeOuts value set to zero.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16304 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c | 96 |
1 files changed, 47 insertions, 49 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index f69b17c..a0c6381 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c @@ -891,64 +891,62 @@ ShowProgress ( EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color;
- if (TimeoutDefault == 0) {
- return EFI_TIMEOUT;
- }
-
- DEBUG ((EFI_D_INFO, "\n\nStart showing progress bar... Press any key to stop it! ...Zzz....\n"));
+ if (TimeoutDefault != 0) {
+ DEBUG ((EFI_D_INFO, "\n\nStart showing progress bar... Press any key to stop it! ...Zzz....\n"));
- SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
- SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
- SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
-
- TmpStr = GetStringById (STRING_TOKEN (STR_START_BOOT_OPTION));
-
- if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
- //
- // Clear the progress status bar first
- //
- if (TmpStr != NULL) {
- PlatformBdsShowProgress (Foreground, Background, TmpStr, Color, 0, 0);
- }
- }
-
-
- TimeoutRemain = TimeoutDefault;
- while (TimeoutRemain != 0) {
- DEBUG ((EFI_D_INFO, "Showing progress bar...Remaining %d second!\n", TimeoutRemain));
-
- Status = WaitForSingleEvent (gST->ConIn->WaitForKey, ONE_SECOND);
- if (Status != EFI_TIMEOUT) {
- break;
- }
- TimeoutRemain--;
+ SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
+ SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
+ SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
+ TmpStr = GetStringById (STRING_TOKEN (STR_START_BOOT_OPTION));
+
if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
//
- // Show progress
+ // Clear the progress status bar first
//
if (TmpStr != NULL) {
- PlatformBdsShowProgress (
- Foreground,
- Background,
- TmpStr,
- Color,
- ((TimeoutDefault - TimeoutRemain) * 100 / TimeoutDefault),
- 0
- );
+ PlatformBdsShowProgress (Foreground, Background, TmpStr, Color, 0, 0);
}
}
- }
-
- if (TmpStr != NULL) {
- gBS->FreePool (TmpStr);
- }
+
- //
- // Timeout expired
- //
- if (TimeoutRemain == 0) {
- return EFI_TIMEOUT;
+ TimeoutRemain = TimeoutDefault;
+ while (TimeoutRemain != 0) {
+ DEBUG ((EFI_D_INFO, "Showing progress bar...Remaining %d second!\n", TimeoutRemain));
+
+ Status = WaitForSingleEvent (gST->ConIn->WaitForKey, ONE_SECOND);
+ if (Status != EFI_TIMEOUT) {
+ break;
+ }
+ TimeoutRemain--;
+
+ if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
+ //
+ // Show progress
+ //
+ if (TmpStr != NULL) {
+ PlatformBdsShowProgress (
+ Foreground,
+ Background,
+ TmpStr,
+ Color,
+ ((TimeoutDefault - TimeoutRemain) * 100 / TimeoutDefault),
+ 0
+ );
+ }
+ }
+ }
+
+ if (TmpStr != NULL) {
+ gBS->FreePool (TmpStr);
+ }
+
+ //
+ // Timeout expired
+ //
+ if (TimeoutRemain == 0) {
+ return EFI_TIMEOUT;
+ }
}
//
|