diff options
author | marcel <marcel@FreeBSD.org> | 2010-01-11 18:10:13 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2010-01-11 18:10:13 +0000 |
commit | ef030a7c4e43d2fb1ce55adec76e421469429f09 (patch) | |
tree | 834b257443dad54b930e9a553da6a313a6b0093e /sys/ia64/include | |
parent | 5467bb48693ab3341378081f870bc148f76d5aa8 (diff) | |
download | FreeBSD-src-ef030a7c4e43d2fb1ce55adec76e421469429f09.zip FreeBSD-src-ef030a7c4e43d2fb1ce55adec76e421469429f09.tar.gz |
Use io(4) for I/O port access on ia64, rather than through sysarch(2).
I/O port access is implemented on Itanium by reading and writing to a
special region in memory. To hide details and avoid misaligned memory
accesses, a process did I/O port reads and writes by making a MD system
call. There's one fatal problem with this approach: unprivileged access
was not being prevented. /dev/io serves that purpose on amd64/i386, so
employ it on ia64 as well. Use an ioctl for doing the actual I/O and
remove the sysarch(2) interface.
Backward compatibility is not being considered. The sysarch(2) approach
was added to support X11, but support for FreeBSD/ia64 was never fully
implemented in X11. Thus, nothing gets broken that didn't need more work
to begin with.
MFC after: 1 week
Diffstat (limited to 'sys/ia64/include')
-rw-r--r-- | sys/ia64/include/iodev.h | 51 | ||||
-rw-r--r-- | sys/ia64/include/sysarch.h | 9 |
2 files changed, 51 insertions, 9 deletions
diff --git a/sys/ia64/include/iodev.h b/sys/ia64/include/iodev.h new file mode 100644 index 0000000..11d05fc --- /dev/null +++ b/sys/ia64/include/iodev.h @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2010 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_IODEV_H_ +#define _MACHINE_IODEV_H_ + +struct iodev_pio_req { + u_int access; +#define IODEV_PIO_READ 0 +#define IODEV_PIO_WRITE 1 + u_int port; + u_int width; + u_int val; +}; + +#define IODEV_PIO _IOWR('I', 0, struct iodev_pio_req) + +#ifdef _KERNEL + +d_open_t ioopen; +d_close_t ioclose; +d_ioctl_t ioioctl; + +#endif + +#endif /* _MACHINE_IODEV_H_ */ diff --git a/sys/ia64/include/sysarch.h b/sys/ia64/include/sysarch.h index a7f39de..c46d100 100644 --- a/sys/ia64/include/sysarch.h +++ b/sys/ia64/include/sysarch.h @@ -32,15 +32,6 @@ #ifndef _MACHINE_SYSARCH_H_ #define _MACHINE_SYSARCH_H_ -#define IA64_IORD 0 -#define IA64_IOWR 1 - -struct ia64_iodesc { - int port; - int width; - unsigned long val; -}; - #ifndef _KERNEL #include <sys/cdefs.h> |