summaryrefslogtreecommitdiffstats
path: root/sys/dev/vkbd
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2006-09-27 19:57:02 +0000
committerru <ru@FreeBSD.org>2006-09-27 19:57:02 +0000
commit4ef62e4ca582414062d69e20a1ccdade4a110938 (patch)
treea886251dab8c19f71a5bfd0199ec1d9b327b3513 /sys/dev/vkbd
parentf6b387ce531fb4ba91958db5aadcb53f89d4ed1b (diff)
downloadFreeBSD-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/vkbd')
-rw-r--r--sys/dev/vkbd/vkbd.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/dev/vkbd/vkbd.c b/sys/dev/vkbd/vkbd.c
index 7795318..9eca6de 100644
--- a/sys/dev/vkbd/vkbd.c
+++ b/sys/dev/vkbd/vkbd.c
@@ -31,6 +31,7 @@
* $FreeBSD$
*/
+#include "opt_compat.h"
#include "opt_kbd.h"
#include <sys/param.h>
@@ -1092,6 +1093,9 @@ vkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
{
vkbd_state_t *state = (vkbd_state_t *) kbd->kb_data;
int i;
+#ifdef COMPAT_FREEBSD6
+ int ival;
+#endif
VKBD_LOCK(state);
@@ -1100,6 +1104,12 @@ vkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
*(int *)arg = state->ks_mode;
break;
+#ifdef COMPAT_FREEBSD6
+ case _IO('K', 7):
+ ival = IOCPARM_IVAL(arg);
+ arg = (caddr_t)&ival;
+ /* FALLTHROUGH */
+#endif
case KDSKBMODE: /* set keyboard mode */
switch (*(int *)arg) {
case K_XLATE:
@@ -1130,6 +1140,12 @@ vkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
*(int *)arg = KBD_LED_VAL(kbd);
break;
+#ifdef COMPAT_FREEBSD6
+ case _IO('K', 66):
+ ival = IOCPARM_IVAL(arg);
+ arg = (caddr_t)&ival;
+ /* FALLTHROUGH */
+#endif
case KDSETLED: /* set keyboard LED */
/* NOTE: lock key state in ks_state won't be changed */
if (*(int *)arg & ~LOCK_MASK) {
@@ -1155,6 +1171,12 @@ vkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
*(int *)arg = state->ks_state & LOCK_MASK;
break;
+#ifdef COMPAT_FREEBSD6
+ case _IO('K', 20):
+ ival = IOCPARM_IVAL(arg);
+ arg = (caddr_t)&ival;
+ /* FALLTHROUGH */
+#endif
case KDSKBSTATE: /* set lock key state */
if (*(int *)arg & ~LOCK_MASK) {
VKBD_UNLOCK(state);
@@ -1174,6 +1196,12 @@ vkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
vkbd_status_changed(state);
break;
+#ifdef COMPAT_FREEBSD6
+ case _IO('K', 67):
+ ival = IOCPARM_IVAL(arg);
+ arg = (caddr_t)&ival;
+ /* FALLTHROUGH */
+#endif
case KDSETRAD: /* set keyboard repeat rate (old interface) */
kbd->kb_delay1 = typematic_delay(*(int *)arg);
kbd->kb_delay2 = typematic_rate(*(int *)arg);
OpenPOWER on IntegriCloud