xref: /freebsd/sys/amd64/include/iodev.h (revision 95ee2897)
18ab2f5ecSMark Murray /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3c49761ddSPedro F. Giffuni  *
48ab2f5ecSMark Murray  * Copyright (c) 2004 Mark R V Murray
58ab2f5ecSMark Murray  * All rights reserved.
68ab2f5ecSMark Murray  *
78ab2f5ecSMark Murray  * Redistribution and use in source and binary forms, with or without
88ab2f5ecSMark Murray  * modification, are permitted provided that the following conditions
98ab2f5ecSMark Murray  * are met:
108ab2f5ecSMark Murray  * 1. Redistributions of source code must retain the above copyright
118ab2f5ecSMark Murray  *    notice, this list of conditions and the following disclaimer
128ab2f5ecSMark Murray  *    in this position and unchanged.
138ab2f5ecSMark Murray  * 2. Redistributions in binary form must reproduce the above copyright
148ab2f5ecSMark Murray  *    notice, this list of conditions and the following disclaimer in the
158ab2f5ecSMark Murray  *    documentation and/or other materials provided with the distribution.
168ab2f5ecSMark Murray  *
178ab2f5ecSMark Murray  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
188ab2f5ecSMark Murray  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
198ab2f5ecSMark Murray  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
208ab2f5ecSMark Murray  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
218ab2f5ecSMark Murray  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
228ab2f5ecSMark Murray  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
238ab2f5ecSMark Murray  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
248ab2f5ecSMark Murray  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
258ab2f5ecSMark Murray  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
268ab2f5ecSMark Murray  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
278ab2f5ecSMark Murray  */
28d8b87887SAttilio Rao #ifndef _MACHINE_IODEV_H_
29d8b87887SAttilio Rao #define	_MACHINE_IODEV_H_
308ab2f5ecSMark Murray 
31d8b87887SAttilio Rao #ifdef _KERNEL
32d8b87887SAttilio Rao #include <machine/cpufunc.h>
33d8b87887SAttilio Rao 
34d8b87887SAttilio Rao #define	iodev_read_1	inb
35d8b87887SAttilio Rao #define	iodev_read_2	inw
36d8b87887SAttilio Rao #define	iodev_read_4	inl
37d8b87887SAttilio Rao #define	iodev_write_1	outb
38d8b87887SAttilio Rao #define	iodev_write_2	outw
39d8b87887SAttilio Rao #define	iodev_write_4	outl
40d8b87887SAttilio Rao 
41d8b87887SAttilio Rao int	 iodev_open(struct thread *td);
42d8b87887SAttilio Rao int	 iodev_close(struct thread *td);
43d8b87887SAttilio Rao int	 iodev_ioctl(u_long cmd, caddr_t data);
44d8b87887SAttilio Rao 
45d8b87887SAttilio Rao #endif /* _KERNEL */
46d8b87887SAttilio Rao #endif /* _MACHINE_IODEV_H_ */
47