]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/pc98/pc98/busiosubr.c
This commit was generated by cvs2svn to compensate for changes in r90019,
[FreeBSD/FreeBSD.git] / sys / pc98 / pc98 / busiosubr.c
1 /* $FreeBSD$ */
2 /*      $NecBSD: busiosubr.c,v 1.30.4.4 1999/08/28 02:25:35 honda Exp $ */
3 /*      $NetBSD$        */
4
5 /*
6  * [NetBSD for NEC PC-98 series]
7  *  Copyright (c) 1996, 1997, 1998
8  *      NetBSD/pc98 porting staff. All rights reserved.
9  *
10  * [Ported for FreeBSD]
11  *  Copyright (c) 2001
12  *      TAKAHASHI Yoshihiro. All rights reserved.
13  * 
14  *  Redistribution and use in source and binary forms, with or without
15  *  modification, are permitted provided that the following conditions
16  *  are met:
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.
24  * 
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.
36  */
37
38 /*
39  * Copyright (c) 1997, 1998
40  *      Naofumi HONDA.  All rights reserved.
41  */
42
43 #include <sys/param.h>
44 #include <sys/systm.h>
45 #include <sys/kernel.h>
46 #include <machine/bus.h>
47
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)
54
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)
61
62 struct bus_space_tag SBUS_io_space_tag = {
63         BUS_SPACE_IO,
64
65         /* direct bus access methods */
66         {
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),
70         },
71
72         /* relocate bus access methods */
73         {
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),
77         }
78 };
79
80 struct bus_space_tag SBUS_mem_space_tag = {
81         BUS_SPACE_MEM,
82
83         /* direct bus access methods */
84         {
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),
88         },
89
90         /* relocate bus access methods */
91         {
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),
95         }
96 };
97
98
99 #include "opt_mecia.h"
100 #ifdef DEV_MECIA
101
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)
104
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)
107
108 struct bus_space_tag NEPC_io_space_tag = {
109         BUS_SPACE_IO,
110
111         /* direct bus access methods */
112         {
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),
116         },
117
118         /* relocate bus access methods */
119         {
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),
123         }
124 };
125
126 struct bus_space_tag NEPC_mem_space_tag = {
127         BUS_SPACE_MEM,
128
129         /* direct bus access methods */
130         {
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),
134         },
135
136         /* relocate bus access methods */
137         {
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),
141         }
142 };
143
144 #endif /* DEV_MECIA */