summaryrefslogtreecommitdiffstats
path: root/sys/dev/atkbdc
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2011-06-06 23:03:37 +0000
committerjkim <jkim@FreeBSD.org>2011-06-06 23:03:37 +0000
commit969ea98a8c5c7a7edcaff07bfa96e0a59950b8f8 (patch)
treedfce85ac09dccbbcc2e11e72164428b6c3b4da01 /sys/dev/atkbdc
parent165e30068eca33d6e882962c2641a8016be2d90a (diff)
downloadFreeBSD-src-969ea98a8c5c7a7edcaff07bfa96e0a59950b8f8.zip
FreeBSD-src-969ea98a8c5c7a7edcaff07bfa96e0a59950b8f8.tar.gz
Validate INT 15h and 16h vectors more strictly. Traditionally these entry
points are fixed addresses and (U)EFI CSM specification also mandated that. Unfortunately, (U)EFI CSM specification does not specifically mention this is to call service routine via interrupt vector table or to jump directly to the entry point. As a result, some CSM seems to install two routines and acts differently, depending on how it was executed, unfortunately. When INT 15h is used, it calls a function pointer (which is probably a UEFI service function). When it jumps directly to the entry point, it executes a simple and traditional INT 15h service routine. Therefore, actually there are two possible fixes, i. e., this fix or jumping directly to the fixed entry point. However, we chose this fix because a) keyboard typematic support via BIOS is becoming extremely rarer and b) we cannot support random service routine installed by a firmware or a boot loader. This should fix Lenovo X220 laptop, specifically. Reviewed by: delphij MFC after: 3 days
Diffstat (limited to 'sys/dev/atkbdc')
-rw-r--r--sys/dev/atkbdc/atkbd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c
index 600020f..b7156cf 100644
--- a/sys/dev/atkbdc/atkbd.c
+++ b/sys/dev/atkbdc/atkbd.c
@@ -1097,7 +1097,8 @@ get_typematic(keyboard_t *kbd)
x86regs_t regs;
uint8_t *p;
- if (x86bios_get_intr(0x15) == 0 || x86bios_get_intr(0x16) == 0)
+ if (x86bios_get_intr(0x15) != 0xf000f859 ||
+ x86bios_get_intr(0x16) != 0xf000e82e)
return (ENODEV);
/* Is BIOS system configuration table supported? */
OpenPOWER on IntegriCloud