aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2016-08-16 14:33:25 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2016-08-16 14:33:25 +0000
commit858a3f496fd101a71c8842edfd9e2770fce87aea (patch)
treed568b03192297e2b3eeee3814291eff3524a21d4 /sys
parent5f306327fe1d57c1c7740c928559bb2dd7c1c328 (diff)
downloadsrc-858a3f496fd101a71c8842edfd9e2770fce87aea.tar.gz
src-858a3f496fd101a71c8842edfd9e2770fce87aea.zip
Only use WaitForKeys event if it exists, this is not the case in u-boot efi implementation.
Reviewed by: jhb, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6781
Notes
Notes: svn path=/head/; revision=304222
Diffstat (limited to 'sys')
-rw-r--r--sys/boot/efi/libefi/efi_console.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/boot/efi/libefi/efi_console.c b/sys/boot/efi/libefi/efi_console.c
index 838becc5d2a6..6ad5d3c1e142 100644
--- a/sys/boot/efi/libefi/efi_console.c
+++ b/sys/boot/efi/libefi/efi_console.c
@@ -438,8 +438,10 @@ efi_cons_getchar()
/* Try to read a key stroke. We wait for one if none is pending. */
status = conin->ReadKeyStroke(conin, &key);
- if (status == EFI_NOT_READY) {
- BS->WaitForEvent(1, &conin->WaitForKey, &junk);
+ while (status == EFI_NOT_READY) {
+ /* Some EFI implementation (u-boot for example) do not support WaitForKey */
+ if (conin->WaitForKey != NULL)
+ BS->WaitForEvent(1, &conin->WaitForKey, &junk);
status = conin->ReadKeyStroke(conin, &key);
}
switch (key.ScanCode) {
@@ -454,6 +456,9 @@ efi_cons_getchar()
int
efi_cons_poll()
{
+
+ if (conin->WaitForKey == NULL)
+ return (1);
/* This can clear the signaled state. */
return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS);
}