svn commit: r355844 - head/stand/efi/libefi

Toomas Soome tsoome at FreeBSD.org
Tue Dec 17 08:30:11 UTC 2019


Author: tsoome
Date: Tue Dec 17 08:30:11 2019
New Revision: 355844
URL: https://svnweb.freebsd.org/changeset/base/355844

Log:
  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

Modified:
  head/stand/efi/libefi/efi_console.c

Modified: head/stand/efi/libefi/efi_console.c
==============================================================================
--- head/stand/efi/libefi/efi_console.c	Tue Dec 17 04:21:35 2019	(r355843)
+++ head/stand/efi/libefi/efi_console.c	Tue Dec 17 08:30:11 2019	(r355844)
@@ -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);
 }


More information about the svn-src-all mailing list