[coreboot] [PATCH] libpayload keyboard driver fix.
Patrick Georgi
patrick at georgi-clan.de
Mon Sep 1 21:29:57 CEST 2008
Uwe Hermann schrieb:
> On Mon, Sep 01, 2008 at 05:53:54PM +0200, Stefan Reinauer wrote:
>
>> fix keyboard driver bugs.
>>
>
> Jordan is probably better-suited to review this, but can you elaborate
> a bit more in the commit message? What bug, what's wrong, what effects does
> the bug have, how is it fixed, etc?
>
The |0x80 codes are "break codes", that means, codes that are emitted
when the key transitions from pressed to non-pressed, so the modifier
was always in the wrong state, as soon as you pressed shift for the
first time.
I have no idea why that didn't occur to me when I looked at it earlier
today :-/
Acked-by: Patrick Georgi <patrick.georgi at coresystems.de>
>
>
>> Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
>>
>> Index: libpayload/drivers/keyboard.c
>> ===================================================================
>> --- libpayload/drivers/keyboard.c (revision 3556)
>> +++ libpayload/drivers/keyboard.c (working copy)
>> @@ -79,7 +79,7 @@
>>
>> int keyboard_getchar(void)
>> {
>> - static int modifier;
>> + static int modifier = 0;
>> unsigned char ch;
>> int shift;
>> int ret = 0;
>> @@ -91,17 +91,17 @@
>> switch (ch) {
>> case 0x36:
>> case 0x2a:
>> - modifier &= ~MOD_SHIFT;
>> + modifier |= MOD_SHIFT;
>> break;
>> case 0x80 | 0x36:
>> case 0x80 | 0x2a:
>> - modifier |= MOD_SHIFT;
>> + modifier &= ~MOD_SHIFT;
>> break;
>> case 0x1d:
>> - modifier &= ~MOD_CTRL;
>> + modifier |= MOD_CTRL;
>> break;
>> case 0x80 | 0x1d:
>> - modifier |= MOD_CTRL;
>> + modifier &= ~MOD_CTRL;
>> break;
>> case 0x3a:
>> if (modifier & MOD_CAPSLOCK)
>>
More information about the coreboot
mailing list