diff options
author | ru <ru@FreeBSD.org> | 2006-09-27 19:57:02 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-09-27 19:57:02 +0000 |
commit | 4ef62e4ca582414062d69e20a1ccdade4a110938 (patch) | |
tree | a886251dab8c19f71a5bfd0199ec1d9b327b3513 /sys/dev/kbdmux | |
parent | f6b387ce531fb4ba91958db5aadcb53f89d4ed1b (diff) | |
download | FreeBSD-src-4ef62e4ca582414062d69e20a1ccdade4a110938.zip FreeBSD-src-4ef62e4ca582414062d69e20a1ccdade4a110938.tar.gz |
Fix our ioctl(2) implementation when the argument is "int". New
ioctls passing integer arguments should use the _IOWINT() macro.
This fixes a lot of ioctl's not working on sparc64, most notable
being keyboard/syscons ioctls.
Full ABI compatibility is provided, with the bonus of fixing the
handling of old ioctls on sparc64.
Reviewed by: bde (with contributions)
Tested by: emax, marius
MFC after: 1 week
Diffstat (limited to 'sys/dev/kbdmux')
-rw-r--r-- | sys/dev/kbdmux/kbdmux.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index d058b8a..8e93272c 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -31,6 +31,7 @@ * $FreeBSD$ */ +#include "opt_compat.h" #include "opt_kbd.h" #include <sys/param.h> @@ -940,6 +941,9 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) kbdmux_kbd_t *k; keyboard_info_t *ki; int error = 0, mode; +#ifdef COMPAT_FREEBSD6 + int ival; +#endif if (state == NULL) return (ENXIO); @@ -1048,6 +1052,12 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) KBDMUX_UNLOCK(state); break; +#ifdef COMPAT_FREEBSD6 + case _IO('K', 7): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif case KDSKBMODE: /* set keyboard mode */ KBDMUX_LOCK(state); @@ -1082,6 +1092,12 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) KBDMUX_UNLOCK(state); break; +#ifdef COMPAT_FREEBSD6 + case _IO('K', 66): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif case KDSETLED: /* set keyboard LED */ KBDMUX_LOCK(state); @@ -1107,6 +1123,12 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) KBDMUX_UNLOCK(state); break; +#ifdef COMPAT_FREEBSD6 + case _IO('K', 20): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif case KDSKBSTATE: /* set lock key state */ KBDMUX_LOCK(state); @@ -1128,6 +1150,13 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) return (kbdmux_ioctl(kbd, KDSETLED, arg)); /* NOT REACHED */ +#ifdef COMPAT_FREEBSD6 + case _IO('K', 67): + cmd = KDSETRAD; + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif case KDSETREPEAT: /* set keyboard repeat rate (new interface) */ case KDSETRAD: /* set keyboard repeat rate (old interface) */ KBDMUX_LOCK(state); |