summaryrefslogtreecommitdiff
path: root/IntelFrameworkPkg/Library
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-15 06:31:43 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-15 06:31:43 +0000
commitabe4c4590b0a88fd97741462008131dc6f35c1a8 (patch)
tree90de7dbf27fd7da157af1f736879f8373f0bb182 /IntelFrameworkPkg/Library
parentf04544be831bc925c1d5dceddd7809bcc298c4d7 (diff)
downloadedk2-platforms-abe4c4590b0a88fd97741462008131dc6f35c1a8.tar.xz
Enhance CreatePopup to call ReadKeyStroke() before calling WaitForEvent(). This can handle the case when in lazy ConIn mode.
Signed-off-by: Ruiyu Ni<ruiyu.ni@intel.com> Reviewed-by: Eric Dong<eric.dong@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13946 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkPkg/Library')
-rw-r--r--IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c
index a8ecc27e64..244e532f57 100644
--- a/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c
+++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c
@@ -1,7 +1,7 @@
/** @file
This module provide help function for displaying unicode string.
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -314,6 +314,7 @@ CreatePopUp (
...
)
{
+ EFI_STATUS Status;
VA_LIST Args;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
EFI_SIMPLE_TEXT_OUTPUT_MODE SavedConsoleMode;
@@ -457,7 +458,19 @@ CreatePopUp (
// Wait for a keystroke
//
if (Key != NULL) {
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- gST->ConIn->ReadKeyStroke (gST->ConIn, Key);
+ while (TRUE) {
+ Status = gST->ConIn->ReadKeyStroke (gST->ConIn, Key);
+ if (!EFI_ERROR (Status)) {
+ break;
+ }
+
+ //
+ // If we encounter error, continue to read another key in.
+ //
+ if (Status != EFI_NOT_READY) {
+ continue;
+ }
+ gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
+ }
}
}