diff options
author | ru <ru@FreeBSD.org> | 2006-09-20 11:43:36 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-09-20 11:43:36 +0000 |
commit | 7dcd8f28e88644c595bfc083293e001284d9f0a9 (patch) | |
tree | 1ac5247b2749e77122cdf4de942129c68fd4fe4a /sys/dev/kbdmux/kbdmux.c | |
parent | edd4f4618e13a37fbad6b145e2058111190b723e (diff) | |
download | FreeBSD-src-7dcd8f28e88644c595bfc083293e001284d9f0a9.zip FreeBSD-src-7dcd8f28e88644c595bfc083293e001284d9f0a9.tar.gz |
Revert back to always using *(int *)arg for now. While this
is incorrect, and causes endianness bugs on 64-bit big-endian
machines (sparc64), it's the best choice for now, as many of
these IOCTLs are used inside the kernel, and bogusly pass an
argument as "int *" which results in unaligned access panics
on sparc64 when attempting to dereference them via *(intptr_t *).
(Several of us are working on a real fix, which is uneasy.)
Diffstat (limited to 'sys/dev/kbdmux/kbdmux.c')
-rw-r--r-- | sys/dev/kbdmux/kbdmux.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index f00d1c6..d058b8a 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -1051,7 +1051,7 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) case KDSKBMODE: /* set keyboard mode */ KBDMUX_LOCK(state); - switch ((int)*(intptr_t *)arg) { + switch (*(int *)arg) { case K_XLATE: if (state->ks_mode != K_XLATE) { /* make lock key state and LED state match */ @@ -1062,9 +1062,9 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) case K_RAW: case K_CODE: - if (state->ks_mode != (int)*(intptr_t *)arg) { + if (state->ks_mode != *(int *)arg) { kbdmux_clear_state_locked(state); - state->ks_mode = (int)*(intptr_t *)arg; + state->ks_mode = *(int *)arg; } break; @@ -1086,13 +1086,13 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) KBDMUX_LOCK(state); /* NOTE: lock key state in ks_state won't be changed */ - if ((int)*(intptr_t *)arg & ~LOCK_MASK) { + if (*(int *)arg & ~LOCK_MASK) { KBDMUX_UNLOCK(state); return (EINVAL); } - KBD_LED_VAL(kbd) = (int)*(intptr_t *)arg; + KBD_LED_VAL(kbd) = *(int *)arg; /* KDSETLED on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) @@ -1110,14 +1110,14 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) case KDSKBSTATE: /* set lock key state */ KBDMUX_LOCK(state); - if ((int)*(intptr_t *)arg & ~LOCK_MASK) { + if (*(int *)arg & ~LOCK_MASK) { KBDMUX_UNLOCK(state); return (EINVAL); } state->ks_state &= ~LOCK_MASK; - state->ks_state |= (int)*(intptr_t *)arg; + state->ks_state |= *(int *)arg; /* KDSKBSTATE on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) @@ -1147,7 +1147,7 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) break; mode |= i; } else - mode = (int)*(intptr_t *)arg; + mode = *(int *)arg; if (mode & ~0x7f) { KBDMUX_UNLOCK(state); |