From 4e198487fa49a81733af196bff65af7b4a8db783 Mon Sep 17 00:00:00 2001 From: macallan Date: Tue, 19 Feb 2013 15:21:08 +0000 Subject: [PATCH] fix a bunch of _IO() ioctl()s to actually work on LP64/BE ( the data pointer is abused to pass an integer, we get a pointer to it so we need to deref it to something the same size as a pointer to get the correct value ) now the PCVT compat code ( which is used for VT switching in and out of X ) works on sparc64 --- sys/dev/wscons/wsdisplay_compat_usl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/wscons/wsdisplay_compat_usl.c b/sys/dev/wscons/wsdisplay_compat_usl.c index 8de2a97cd0da..444bbe6d2154 100644 --- a/sys/dev/wscons/wsdisplay_compat_usl.c +++ b/sys/dev/wscons/wsdisplay_compat_usl.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_compat_usl.c,v 1.47 2010/07/01 02:38:29 rmind Exp $ */ +/* $NetBSD: wsdisplay_compat_usl.c,v 1.48 2013/02/19 15:21:08 macallan Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_compat_usl.c,v 1.47 2010/07/01 02:38:29 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_compat_usl.c,v 1.48 2013/02/19 15:21:08 macallan Exp $"); #include "opt_compat_freebsd.h" #include "opt_compat_netbsd.h" @@ -449,7 +449,7 @@ wsdisplay_usl_ioctl2(struct wsdisplay_softc *sc, struct wsscreen *scr, */ case KDSETMODE: req = WSDISPLAYIO_SMODE; -#define d (*(int *)data) +#define d (*(long *)data) switch (d) { case KD_GRAPHICS: intarg = WSDISPLAYIO_MODE_MAPPED; @@ -465,7 +465,7 @@ wsdisplay_usl_ioctl2(struct wsdisplay_softc *sc, struct wsscreen *scr, break; case KDMKTONE: req = WSKBDIO_COMPLEXBELL; -#define d (*(int *)data) +#define d (*(long *)data) if (d) { #define PCVT_SYSBEEPF 1193182 if (d >> 16) { @@ -486,7 +486,7 @@ wsdisplay_usl_ioctl2(struct wsdisplay_softc *sc, struct wsscreen *scr, case KDSETLED: req = WSKBDIO_SETLEDS; intarg = 0; -#define d (*(int *)data) +#define d (*(long *)data) if (d & LED_CAP) intarg |= WSKBD_LED_CAPS; if (d & LED_NUM) @@ -503,7 +503,7 @@ wsdisplay_usl_ioctl2(struct wsdisplay_softc *sc, struct wsscreen *scr, #ifdef WSDISPLAY_COMPAT_RAWKBD case KDSKBMODE: req = WSKBDIO_SETMODE; - switch (*(int *)data) { + switch (*(long *)data) { case K_RAW: intarg = WSKBD_RAW; break;