summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-08-21 15:17:22 +0200
committerKay Sievers <kay@vrfy.org>2013-08-21 15:17:22 +0200
commit5d85fe49d5f7c5bf4f0bb0485c25f945b3bd6e57 (patch)
treee0503d833744f1ae6402b17b8b3b050c8e32b61a /src
parenta1da1ca6721f3b49cf45a7c3a08126b10b4ff772 (diff)
fall back to SimpleTextInputProtocol if we can't read a key
Diffstat (limited to 'src')
-rw-r--r--src/efi/gummiboot.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c
index 6b07f97..844ce5f 100644
--- a/src/efi/gummiboot.c
+++ b/src/efi/gummiboot.c
@@ -379,8 +379,14 @@ static EFI_STATUS key_read(UINT64 *key, BOOLEAN wait) {
if (wait)
uefi_call_wrapper(BS->WaitForEvent, 3, 1, &TextInputEx->WaitForKeyEx, &index);
err = uefi_call_wrapper(TextInputEx->ReadKeyStrokeEx, 2, TextInputEx, &keydata);
- if (EFI_ERROR(err))
+ if (EFI_ERROR(err)) {
+ /* hmm, we waited but we could read a key; some firmwares seem
+ * to provide SimpleTextInputExProtocol but it does not do the
+ * right thing; just fall back to SimpleTextInputProtocol. */
+ if (wait)
+ TextInputEx = NULL;
return err;
+ }
/* do not distinguish between left and right keys */
if (keydata.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) {