summaryrefslogtreecommitdiff
path: root/stand/efi
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2019-12-17 08:30:11 +0000
committerToomas Soome <tsoome@FreeBSD.org>2019-12-17 08:30:11 +0000
commitade8a0f1d11068161243e5d2ebfe2942f5561ad7 (patch)
tree2c0fd5dae642cb58c22694abecde4387341dd2af /stand/efi
parent359e4dba07000029c8ae7f0c02ff97a92fbcd23b (diff)
downloadsrc-test-ade8a0f1d11068161243e5d2ebfe2942f5561ad7.tar.gz
src-test-ade8a0f1d11068161243e5d2ebfe2942f5561ad7.zip
loader.efi: efi_readkey_ex needs to key despite the shift status or toggle status
From UEFI specification 2.8, page 434: "It should also be noted that certain input devices may not be able to produce shift or toggle state information, and in those cases the high order bit in the respective Toggle and Shift state fields should not be active." But we still need to check for ScanCode and UnicodeChar. PR: 242660 Reported by: Trond Endrestol MFC after: 1 week
Notes
Notes: svn path=/head/; revision=355844
Diffstat (limited to 'stand/efi')
-rw-r--r--stand/efi/libefi/efi_console.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c
index 1b73934336e9f..1b096a9635550 100644
--- a/stand/efi/libefi/efi_console.c
+++ b/stand/efi/libefi/efi_console.c
@@ -1126,11 +1126,15 @@ efi_readkey_ex(void)
kp->UnicodeChar++;
}
}
- if (kp->ScanCode == 0 && kp->UnicodeChar == 0)
- return (false);
- keybuf_inschar(kp);
- return (true);
}
+ /*
+ * The shift state and/or toggle state may not be valid,
+ * but we still can have ScanCode or UnicodeChar.
+ */
+ if (kp->ScanCode == 0 && kp->UnicodeChar == 0)
+ return (false);
+ keybuf_inschar(kp);
+ return (true);
}
return (false);
}