2 /* $NecBSD: busiosubr.c,v 1.30.4.4 1999/08/28 02:25:35 honda Exp $ */
6 * [NetBSD for NEC PC-98 series]
7 * Copyright (c) 1996, 1997, 1998
8 * NetBSD/pc98 porting staff. All rights reserved.
10 * [Ported for FreeBSD]
12 * TAKAHASHI Yoshihiro. All rights reserved.
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. The name of the author may not be used to endorse or promote products
23 * derived from this software without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
29 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
39 * Copyright (c) 1997, 1998
40 * Naofumi HONDA. All rights reserved.
43 #include <sys/param.h>
44 #include <sys/systm.h>
45 #include <sys/kernel.h>
46 #include <machine/bus.h>
48 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_io,u_int8_t,1)
49 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_io,u_int16_t,2)
50 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_io,u_int32_t,4)
51 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_mem,u_int8_t,1)
52 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_mem,u_int16_t,2)
53 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_mem,u_int32_t,4)
55 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_io,u_int8_t,1)
56 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_io,u_int16_t,2)
57 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_io,u_int32_t,4)
58 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int8_t,1)
59 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int16_t,2)
60 _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int32_t,4)
62 struct bus_space_tag SBUS_io_space_tag = {
65 /* direct bus access methods */
67 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int8_t,1),
68 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int16_t,2),
69 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int32_t,4),
72 /* relocate bus access methods */
74 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int8_t,1),
75 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int16_t,2),
76 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int32_t,4),
80 struct bus_space_tag SBUS_mem_space_tag = {
83 /* direct bus access methods */
85 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int8_t,1),
86 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int16_t,2),
87 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int32_t,4),
90 /* relocate bus access methods */
92 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int8_t,1),
93 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int16_t,2),
94 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int32_t,4),
99 #include "opt_mecia.h"
102 _BUS_SPACE_CALL_FUNCS_PROTO(NEPC_DA_io,u_int16_t,2)
103 _BUS_SPACE_CALL_FUNCS_PROTO(NEPC_DA_io,u_int32_t,4)
105 _BUS_SPACE_CALL_FUNCS_PROTO(NEPC_RA_io,u_int16_t,2)
106 _BUS_SPACE_CALL_FUNCS_PROTO(NEPC_RA_io,u_int32_t,4)
108 struct bus_space_tag NEPC_io_space_tag = {
111 /* direct bus access methods */
113 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int8_t,1),
114 _BUS_SPACE_CALL_FUNCS_TAB(NEPC_DA_io,u_int16_t,2),
115 _BUS_SPACE_CALL_FUNCS_TAB(NEPC_DA_io,u_int32_t,4),
118 /* relocate bus access methods */
120 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int8_t,1),
121 _BUS_SPACE_CALL_FUNCS_TAB(NEPC_RA_io,u_int16_t,2),
122 _BUS_SPACE_CALL_FUNCS_TAB(NEPC_RA_io,u_int32_t,4),
126 struct bus_space_tag NEPC_mem_space_tag = {
129 /* direct bus access methods */
131 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int8_t,1),
132 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int16_t,2),
133 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int32_t,4),
136 /* relocate bus access methods */
138 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int8_t,1),
139 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int16_t,2),
140 _BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int32_t,4),
144 #endif /* DEV_MECIA */