j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: afaerber Date: Sat Oct 30 14:22:06 2010 New Revision: 924 URL: http://tracker.coreboot.org/trac/openbios/changeset/924
Log: adb: Don't assume that pointers fit in 32 bits
The adb_dev_t state field is used to store a adb_kbd_t pointer. It is unused in the mouse driver.
v2: * Change field type from uint32_t to void* to avoid uintptr_t casts in keyboard driver.
Signed-off-by: Andreas Färber andreas.faerber@web.de Acked-by: Alexander Graf agraf@suse.de
Modified: trunk/openbios-devel/drivers/adb_bus.h trunk/openbios-devel/drivers/adb_kbd.c
Modified: trunk/openbios-devel/drivers/adb_bus.h ============================================================================== --- trunk/openbios-devel/drivers/adb_bus.h Thu Oct 28 22:53:58 2010 (r923) +++ trunk/openbios-devel/drivers/adb_bus.h Sat Oct 30 14:22:06 2010 (r924) @@ -32,7 +32,7 @@ adb_bus_t *bus; uint8_t addr; uint8_t type; - uint32_t state; + void *state; };
#define ADB_BUF_SIZE 8
Modified: trunk/openbios-devel/drivers/adb_kbd.c ============================================================================== --- trunk/openbios-devel/drivers/adb_kbd.c Thu Oct 28 22:53:58 2010 (r923) +++ trunk/openbios-devel/drivers/adb_kbd.c Sat Oct 30 14:22:06 2010 (r924) @@ -483,7 +483,7 @@ int key; int ret;
- kbd = (void *)dev->state; + kbd = dev->state;
if (kbd->len > 0) { ret = kbd->sequence[kbd->len-- - 1]; @@ -531,7 +531,7 @@ ADB_kbd_us, ADB_sequences); kbd->next_key = -1; kbd->len = 0; - dev->state = (int32_t)kbd; + dev->state = kbd; my_adb_dev = dev; }