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/digi | |
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/digi')
-rw-r--r-- | sys/dev/digi/digi.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c index 2eb72b0..7adc72a 100644 --- a/sys/dev/digi/digi.c +++ b/sys/dev/digi/digi.c @@ -913,6 +913,10 @@ digiioctl(struct tty *tp, u_long cmd, void *data, int flag, struct thread *td) { struct digi_softc *sc; struct digi_p *port; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + int ival; +#endif port = tp->t_sc; sc = port->sc; @@ -942,8 +946,15 @@ digiioctl(struct tty *tp, u_long cmd, void *data, int flag, struct thread *td) } } return (0); +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('e', 'C'): + ival = IOCPARM_IVAL(data); + data = &ival; + /* FALLTHROUGH */ +#endif case DIGIIO_RING: - port->send_ring = *(u_char *)data; + port->send_ring = (u_char)*(int *)data; break; default: return (ENOTTY); |