Revision: 13942
http://edk2.svn.sourceforge.net/edk2/?rev=13942&view=rev
Author: niruiyu
Date: 2012-11-14 06:30:39 +0000 (Wed, 14 Nov 2012)
Log Message:
-----------
Enhance SetupBrowser to call ReadKeyStroke() before calling WaitForEvent().
This can handle the case when the UI is launched in lazy ConIn mode.
Signed-off-by: Ruiyu Ni<[email protected]>
Reviewed-by: Eric Dong<[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
Modified: trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
2012-11-14 05:12:40 UTC (rev 13941)
+++ trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
2012-11-14 06:30:39 UTC (rev 13942)
@@ -1384,10 +1384,17 @@
{
EFI_STATUS Status;
- do {
- UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, 0);
+ while (TRUE) {
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, Key);
- } while (EFI_ERROR(Status));
+ if (!EFI_ERROR (Status)) {
+ break;
+ }
+ if (Status != EFI_NOT_READY) {
+ continue;
+ }
+
+ UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0, 0);
+ }
return Status;
}
Modified: trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c 2012-11-14
05:12:40 UTC (rev 13941)
+++ trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c 2012-11-14
06:30:39 UTC (rev 13942)
@@ -3110,25 +3110,33 @@
//
// Wait for user's selection
//
- do {
- Status = UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0,
MinRefreshInterval);
- } while (Status == EFI_TIMEOUT);
+ while (TRUE) {
+ Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
+ if (!EFI_ERROR (Status)) {
+ break;
+ }
- if (Selection->Action == UI_ACTION_REFRESH_FORMSET) {
//
- // IFR is updated in Callback of refresh opcode, re-parse it
+ // If we encounter error, continue to read another key in.
//
- ControlFlag = CfCheckSelection;
- Selection->Statement = NULL;
- break;
+ if (Status != EFI_NOT_READY) {
+ continue;
+ }
+
+ Status = UiWaitForSingleEvent (gST->ConIn->WaitForKey, 0,
MinRefreshInterval);
+ ASSERT_EFI_ERROR (Status);
+
+ if (Selection->Action == UI_ACTION_REFRESH_FORMSET) {
+ //
+ // IFR is updated in Callback of refresh opcode, re-parse it
+ //
+ ControlFlag = CfCheckSelection;
+ Selection->Statement = NULL;
+ break;
+ }
}
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- //
- // If we encounter error, continue to read another key in.
- //
- if (EFI_ERROR (Status)) {
- ControlFlag = CfReadKey;
+ if (ControlFlag == CfCheckSelection) {
break;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits