Deleted Added
full compact
bus.h (291056) bus.h (297001)
1/* $NetBSD: bus.h,v 1.11 2003/07/28 17:35:54 thorpej Exp $ */
2
3/*-
4 * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33/*-
34 * Copyright (c) 1996 Charles M. Hannum. All rights reserved.
35 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
45 * 3. All advertising materials mentioning features or use of this software
46 * must display the following acknowledgement:
47 * This product includes software developed by Christopher G. Demetriou
48 * for the NetBSD Project.
49 * 4. The name of the author may not be used to endorse or promote products
50 * derived from this software without specific prior written permission
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
53 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
54 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
55 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
56 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
57 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
61 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 *
1/* $NetBSD: bus.h,v 1.11 2003/07/28 17:35:54 thorpej Exp $ */
2
3/*-
4 * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33/*-
34 * Copyright (c) 1996 Charles M. Hannum. All rights reserved.
35 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 * 1. Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * 2. Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in the
44 * documentation and/or other materials provided with the distribution.
45 * 3. All advertising materials mentioning features or use of this software
46 * must display the following acknowledgement:
47 * This product includes software developed by Christopher G. Demetriou
48 * for the NetBSD Project.
49 * 4. The name of the author may not be used to endorse or promote products
50 * derived from this software without specific prior written permission
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
53 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
54 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
55 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
56 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
57 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
61 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 *
63 * $FreeBSD: head/sys/powerpc/include/bus.h 291056 2015-11-19 04:41:16Z jhibbits $
63 * $FreeBSD: head/sys/powerpc/include/bus.h 297001 2016-03-18 01:30:58Z jhibbits $
64 */
65
66#ifndef _MACHINE_BUS_H_
67#define _MACHINE_BUS_H_
68
69#include <machine/_bus.h>
70
71#define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
72
73#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFFUL
74#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFFUL
75#define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFFUL
76#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFFUL
77
78#ifdef __powerpc64__
79#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFUL
80#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFFUL
81#else
64 */
65
66#ifndef _MACHINE_BUS_H_
67#define _MACHINE_BUS_H_
68
69#include <machine/_bus.h>
70
71#define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
72
73#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFFUL
74#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFFUL
75#define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFFUL
76#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFFUL
77
78#ifdef __powerpc64__
79#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFUL
80#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFFUL
81#else
82#ifdef BOOKE
83#define BUS_SPACE_MAXADDR 0xFFFFFFFFFULL
84#define BUS_SPACE_MAXSIZE 0xFFFFFFFFUL
85#else
82#define BUS_SPACE_MAXADDR 0xFFFFFFFFUL
83#define BUS_SPACE_MAXSIZE 0xFFFFFFFFUL
84#endif
86#define BUS_SPACE_MAXADDR 0xFFFFFFFFUL
87#define BUS_SPACE_MAXSIZE 0xFFFFFFFFUL
88#endif
89#endif
85
86#define BUS_SPACE_MAP_CACHEABLE 0x01
87#define BUS_SPACE_MAP_LINEAR 0x02
88#define BUS_SPACE_MAP_PREFETCHABLE 0x04
89
90#define BUS_SPACE_UNRESTRICTED (~0)
91
92#define BUS_SPACE_BARRIER_READ 0x01
93#define BUS_SPACE_BARRIER_WRITE 0x02
94
95struct bus_space_access;
96
97struct bus_space {
98 /* mapping/unmapping */
99 int (*bs_map)(bus_addr_t, bus_size_t, int,
100 bus_space_handle_t *);
101 void (*bs_unmap)(bus_size_t);
102 int (*bs_subregion)(bus_space_handle_t, bus_size_t,
103 bus_size_t, bus_space_handle_t *);
104
105 /* allocation/deallocation */
106 int (*bs_alloc)(bus_addr_t, bus_addr_t, bus_size_t,
107 bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
108 void (*bs_free)(bus_space_handle_t, bus_size_t);
109
110 void (*bs_barrier)(bus_space_handle_t, bus_size_t,
111 bus_size_t, int);
112
113 /* Read single. */
114 uint8_t (*bs_r_1)(bus_space_handle_t, bus_size_t);
115 uint16_t (*bs_r_2)(bus_space_handle_t, bus_size_t);
116 uint32_t (*bs_r_4)(bus_space_handle_t, bus_size_t);
117 uint64_t (*bs_r_8)(bus_space_handle_t, bus_size_t);
118
119 uint16_t (*bs_r_s_2)(bus_space_handle_t, bus_size_t);
120 uint32_t (*bs_r_s_4)(bus_space_handle_t, bus_size_t);
121 uint64_t (*bs_r_s_8)(bus_space_handle_t, bus_size_t);
122
123 /* read multiple */
124 void (*bs_rm_1)(bus_space_handle_t, bus_size_t, uint8_t *,
125 bus_size_t);
126 void (*bs_rm_2)(bus_space_handle_t, bus_size_t, uint16_t *,
127 bus_size_t);
128 void (*bs_rm_4)(bus_space_handle_t, bus_size_t, uint32_t *,
129 bus_size_t);
130 void (*bs_rm_8)(bus_space_handle_t, bus_size_t, uint64_t *,
131 bus_size_t);
132
133 void (*bs_rm_s_2)(bus_space_handle_t, bus_size_t, uint16_t *,
134 bus_size_t);
135 void (*bs_rm_s_4)(bus_space_handle_t, bus_size_t, uint32_t *,
136 bus_size_t);
137 void (*bs_rm_s_8)(bus_space_handle_t, bus_size_t, uint64_t *,
138 bus_size_t);
139
140 /* read region */
141 void (*bs_rr_1)(bus_space_handle_t, bus_size_t, uint8_t *,
142 bus_size_t);
143 void (*bs_rr_2)(bus_space_handle_t, bus_size_t, uint16_t *,
144 bus_size_t);
145 void (*bs_rr_4)(bus_space_handle_t, bus_size_t, uint32_t *,
146 bus_size_t);
147 void (*bs_rr_8)(bus_space_handle_t, bus_size_t, uint64_t *,
148 bus_size_t);
149
150 void (*bs_rr_s_2)(bus_space_handle_t, bus_size_t, uint16_t *,
151 bus_size_t);
152 void (*bs_rr_s_4)(bus_space_handle_t, bus_size_t, uint32_t *,
153 bus_size_t);
154 void (*bs_rr_s_8)(bus_space_handle_t, bus_size_t, uint64_t *,
155 bus_size_t);
156
157 /* write */
158 void (*bs_w_1)(bus_space_handle_t, bus_size_t, uint8_t);
159 void (*bs_w_2)(bus_space_handle_t, bus_size_t, uint16_t);
160 void (*bs_w_4)(bus_space_handle_t, bus_size_t, uint32_t);
161 void (*bs_w_8)(bus_space_handle_t, bus_size_t, uint64_t);
162
163 void (*bs_w_s_2)(bus_space_handle_t, bus_size_t, uint16_t);
164 void (*bs_w_s_4)(bus_space_handle_t, bus_size_t, uint32_t);
165 void (*bs_w_s_8)(bus_space_handle_t, bus_size_t, uint64_t);
166
167 /* write multiple */
168 void (*bs_wm_1)(bus_space_handle_t, bus_size_t,
169 const uint8_t *, bus_size_t);
170 void (*bs_wm_2)(bus_space_handle_t, bus_size_t,
171 const uint16_t *, bus_size_t);
172 void (*bs_wm_4)(bus_space_handle_t, bus_size_t,
173 const uint32_t *, bus_size_t);
174 void (*bs_wm_8)(bus_space_handle_t, bus_size_t,
175 const uint64_t *, bus_size_t);
176
177 void (*bs_wm_s_2)(bus_space_handle_t, bus_size_t,
178 const uint16_t *, bus_size_t);
179 void (*bs_wm_s_4)(bus_space_handle_t, bus_size_t,
180 const uint32_t *, bus_size_t);
181 void (*bs_wm_s_8)(bus_space_handle_t, bus_size_t,
182 const uint64_t *, bus_size_t);
183
184 /* write region */
185 void (*bs_wr_1)(bus_space_handle_t, bus_size_t,
186 const uint8_t *, bus_size_t);
187 void (*bs_wr_2)(bus_space_handle_t, bus_size_t,
188 const uint16_t *, bus_size_t);
189 void (*bs_wr_4)(bus_space_handle_t, bus_size_t,
190 const uint32_t *, bus_size_t);
191 void (*bs_wr_8)(bus_space_handle_t, bus_size_t,
192 const uint64_t *, bus_size_t);
193
194 void (*bs_wr_s_2)(bus_space_handle_t, bus_size_t,
195 const uint16_t *, bus_size_t);
196 void (*bs_wr_s_4)(bus_space_handle_t, bus_size_t,
197 const uint32_t *, bus_size_t);
198 void (*bs_wr_s_8)(bus_space_handle_t, bus_size_t,
199 const uint64_t *, bus_size_t);
200
201 /* set multiple */
202 void (*bs_sm_1)(bus_space_handle_t, bus_size_t, uint8_t,
203 bus_size_t);
204 void (*bs_sm_2)(bus_space_handle_t, bus_size_t, uint16_t,
205 bus_size_t);
206 void (*bs_sm_4)(bus_space_handle_t, bus_size_t, uint32_t,
207 bus_size_t);
208 void (*bs_sm_8)(bus_space_handle_t, bus_size_t, uint64_t,
209 bus_size_t);
210
211 void (*bs_sm_s_2)(bus_space_handle_t, bus_size_t, uint16_t,
212 bus_size_t);
213 void (*bs_sm_s_4)(bus_space_handle_t, bus_size_t, uint32_t,
214 bus_size_t);
215 void (*bs_sm_s_8)(bus_space_handle_t, bus_size_t, uint64_t,
216 bus_size_t);
217
218 /* set region */
219 void (*bs_sr_1)(bus_space_handle_t, bus_size_t, uint8_t,
220 bus_size_t);
221 void (*bs_sr_2)(bus_space_handle_t, bus_size_t, uint16_t,
222 bus_size_t);
223 void (*bs_sr_4)(bus_space_handle_t, bus_size_t, uint32_t,
224 bus_size_t);
225 void (*bs_sr_8)(bus_space_handle_t, bus_size_t, uint64_t,
226 bus_size_t);
227
228 void (*bs_sr_s_2)(bus_space_handle_t, bus_size_t, uint16_t,
229 bus_size_t);
230 void (*bs_sr_s_4)(bus_space_handle_t, bus_size_t, uint32_t,
231 bus_size_t);
232 void (*bs_sr_s_8)(bus_space_handle_t, bus_size_t, uint64_t,
233 bus_size_t);
234
235 /* copy region */
236 void (*bs_cr_1)(bus_space_handle_t, bus_size_t,
237 bus_space_handle_t, bus_size_t, bus_size_t);
238 void (*bs_cr_2)(bus_space_handle_t, bus_size_t,
239 bus_space_handle_t, bus_size_t, bus_size_t);
240 void (*bs_cr_4)(bus_space_handle_t, bus_size_t,
241 bus_space_handle_t, bus_size_t, bus_size_t);
242 void (*bs_cr_8)(bus_space_handle_t, bus_size_t,
243 bus_space_handle_t, bus_size_t, bus_size_t);
244
245 void (*bs_cr_s_2)(bus_space_handle_t, bus_size_t,
246 bus_space_handle_t, bus_size_t, bus_size_t);
247 void (*bs_cr_s_4)(bus_space_handle_t, bus_size_t,
248 bus_space_handle_t, bus_size_t, bus_size_t);
249 void (*bs_cr_s_8)(bus_space_handle_t, bus_size_t,
250 bus_space_handle_t, bus_size_t, bus_size_t);
251};
252
253extern struct bus_space bs_be_tag;
254extern struct bus_space bs_le_tag;
255
256#define __bs_c(a,b) __CONCAT(a,b)
257#define __bs_opname(op,size) __bs_c(__bs_c(__bs_c(bs_,op),_),size)
258
259#define __bs_rs(sz, t, h, o) \
260 (*(t)->__bs_opname(r,sz))(h, o)
261#define __bs_ws(sz, t, h, o, v) \
262 (*(t)->__bs_opname(w,sz))(h, o, v)
263#define __bs_nonsingle(type, sz, t, h, o, a, c) \
264 (*(t)->__bs_opname(type,sz))(h, o, a, c)
265#define __bs_set(type, sz, t, h, o, v, c) \
266 (*(t)->__bs_opname(type,sz))(h, o, v, c)
267#define __bs_copy(sz, t, h1, o1, h2, o2, cnt) \
268 (*(t)->__bs_opname(c,sz))(h1, o1, h2, o2, cnt)
269
270/*
271 * Mapping and unmapping operations.
272 */
273#define bus_space_map(t, a, s, c, hp) (*(t)->bs_map)(a, s, c, hp)
274#define bus_space_unmap(t, h, s) (*(t)->bs_unmap)(h, s)
275#define bus_space_subregion(t, h, o, s, hp) (*(t)->bs_subregion)(h, o, s, hp)
276
277/*
278 * Allocation and deallocation operations.
279 */
280#define bus_space_alloc(t, rs, re, s, a, b, c, ap, hp) \
281 (*(t)->bs_alloc)(rs, re, s, a, b, c, ap, hp)
282#define bus_space_free(t, h, s) \
283 (*(t)->bs_free)(h, s)
284
285/*
286 * Bus barrier operations.
287 */
288#define bus_space_barrier(t, h, o, l, f) (*(t)->bs_barrier)(h, o, l, f)
289
290/*
291 * Bus read (single) operations.
292 */
293#define bus_space_read_1(t, h, o) __bs_rs(1,t,h,o)
294#define bus_space_read_2(t, h, o) __bs_rs(2,t,h,o)
295#define bus_space_read_4(t, h, o) __bs_rs(4,t,h,o)
296#define bus_space_read_8(t, h, o) __bs_rs(8,t,h,o)
297
298#define bus_space_read_stream_1 bus_space_read_1
299#define bus_space_read_stream_2(t, h, o) __bs_rs(s_2,t,h,o)
300#define bus_space_read_stream_4(t, h, o) __bs_rs(s_4,t,h,o)
301#define bus_space_read_stream_8(t, h, o) __bs_rs(s_8,t,h,o)
302
303/*
304 * Bus read multiple operations.
305 */
306#define bus_space_read_multi_1(t, h, o, a, c) \
307 __bs_nonsingle(rm,1,(t),(h),(o),(a),(c))
308#define bus_space_read_multi_2(t, h, o, a, c) \
309 __bs_nonsingle(rm,2,(t),(h),(o),(a),(c))
310#define bus_space_read_multi_4(t, h, o, a, c) \
311 __bs_nonsingle(rm,4,(t),(h),(o),(a),(c))
312#define bus_space_read_multi_8(t, h, o, a, c) \
313 __bs_nonsingle(rm,8,(t),(h),(o),(a),(c))
314
315#define bus_space_read_multi_stream_1 bus_space_read_multi_1
316#define bus_space_read_multi_stream_2(t, h, o, a, c) \
317 __bs_nonsingle(rm,s_2,(t),(h),(o),(a),(c))
318#define bus_space_read_multi_stream_4(t, h, o, a, c) \
319 __bs_nonsingle(rm,s_4,(t),(h),(o),(a),(c))
320#define bus_space_read_multi_stream_8(t, h, o, a, c) \
321 __bs_nonsingle(rm,s_8,(t),(h),(o),(a),(c))
322
323/*
324 * Bus read region operations.
325 */
326#define bus_space_read_region_1(t, h, o, a, c) \
327 __bs_nonsingle(rr,1,(t),(h),(o),(a),(c))
328#define bus_space_read_region_2(t, h, o, a, c) \
329 __bs_nonsingle(rr,2,(t),(h),(o),(a),(c))
330#define bus_space_read_region_4(t, h, o, a, c) \
331 __bs_nonsingle(rr,4,(t),(h),(o),(a),(c))
332#define bus_space_read_region_8(t, h, o, a, c) \
333 __bs_nonsingle(rr,8,(t),(h),(o),(a),(c))
334
335#define bus_space_read_region_stream_1 bus_space_read_region_1
336#define bus_space_read_region_stream_2(t, h, o, a, c) \
337 __bs_nonsingle(rr,s_2,(t),(h),(o),(a),(c))
338#define bus_space_read_region_stream_4(t, h, o, a, c) \
339 __bs_nonsingle(rr,s_4,(t),(h),(o),(a),(c))
340#define bus_space_read_region_stream_8(t, h, o, a, c) \
341 __bs_nonsingle(rr,s_8,(t),(h),(o),(a),(c))
342
343/*
344 * Bus write (single) operations.
345 */
346#define bus_space_write_1(t, h, o, v) __bs_ws(1,(t),(h),(o),(v))
347#define bus_space_write_2(t, h, o, v) __bs_ws(2,(t),(h),(o),(v))
348#define bus_space_write_4(t, h, o, v) __bs_ws(4,(t),(h),(o),(v))
349#define bus_space_write_8(t, h, o, v) __bs_ws(8,(t),(h),(o),(v))
350
351#define bus_space_write_stream_1 bus_space_write_1
352#define bus_space_write_stream_2(t, h, o, v) __bs_ws(s_2,(t),(h),(o),(v))
353#define bus_space_write_stream_4(t, h, o, v) __bs_ws(s_4,(t),(h),(o),(v))
354#define bus_space_write_stream_8(t, h, o, v) __bs_ws(s_8,(t),(h),(o),(v))
355
356/*
357 * Bus write multiple operations.
358 */
359#define bus_space_write_multi_1(t, h, o, a, c) \
360 __bs_nonsingle(wm,1,(t),(h),(o),(a),(c))
361#define bus_space_write_multi_2(t, h, o, a, c) \
362 __bs_nonsingle(wm,2,(t),(h),(o),(a),(c))
363#define bus_space_write_multi_4(t, h, o, a, c) \
364 __bs_nonsingle(wm,4,(t),(h),(o),(a),(c))
365#define bus_space_write_multi_8(t, h, o, a, c) \
366 __bs_nonsingle(wm,8,(t),(h),(o),(a),(c))
367
368#define bus_space_write_multi_stream_1 bus_space_write_multi_1
369#define bus_space_write_multi_stream_2(t, h, o, a, c) \
370 __bs_nonsingle(wm,s_2,(t),(h),(o),(a),(c))
371#define bus_space_write_multi_stream_4(t, h, o, a, c) \
372 __bs_nonsingle(wm,s_4,(t),(h),(o),(a),(c))
373#define bus_space_write_multi_stream_8(t, h, o, a, c) \
374 __bs_nonsingle(wm,s_8,(t),(h),(o),(a),(c))
375
376/*
377 * Bus write region operations.
378 */
379#define bus_space_write_region_1(t, h, o, a, c) \
380 __bs_nonsingle(wr,1,(t),(h),(o),(a),(c))
381#define bus_space_write_region_2(t, h, o, a, c) \
382 __bs_nonsingle(wr,2,(t),(h),(o),(a),(c))
383#define bus_space_write_region_4(t, h, o, a, c) \
384 __bs_nonsingle(wr,4,(t),(h),(o),(a),(c))
385#define bus_space_write_region_8(t, h, o, a, c) \
386 __bs_nonsingle(wr,8,(t),(h),(o),(a),(c))
387
388#define bus_space_write_region_stream_1 bus_space_write_region_1
389#define bus_space_write_region_stream_2(t, h, o, a, c) \
390 __bs_nonsingle(wr,s_2,(t),(h),(o),(a),(c))
391#define bus_space_write_region_stream_4(t, h, o, a, c) \
392 __bs_nonsingle(wr,s_4,(t),(h),(o),(a),(c))
393#define bus_space_write_region_stream_8(t, h, o, a, c) \
394 __bs_nonsingle(wr,s_8,(t),(h),(o),(a),(c))
395
396/*
397 * Set multiple operations.
398 */
399#define bus_space_set_multi_1(t, h, o, v, c) \
400 __bs_set(sm,1,(t),(h),(o),(v),(c))
401#define bus_space_set_multi_2(t, h, o, v, c) \
402 __bs_set(sm,2,(t),(h),(o),(v),(c))
403#define bus_space_set_multi_4(t, h, o, v, c) \
404 __bs_set(sm,4,(t),(h),(o),(v),(c))
405#define bus_space_set_multi_8(t, h, o, v, c) \
406 __bs_set(sm,8,(t),(h),(o),(v),(c))
407
408#define bus_space_set_multi_stream_1 bus_space_set_multi_1
409#define bus_space_set_multi_stream_2(t, h, o, v, c) \
410 __bs_set(sm,s_2,(t),(h),(o),(v),(c))
411#define bus_space_set_multi_stream_4(t, h, o, v, c) \
412 __bs_set(sm,s_4,(t),(h),(o),(v),(c))
413#define bus_space_set_multi_stream_8(t, h, o, v, c) \
414 __bs_set(sm,s_8,(t),(h),(o),(v),(c))
415
416/*
417 * Set region operations.
418 */
419#define bus_space_set_region_1(t, h, o, v, c) \
420 __bs_set(sr,1,(t),(h),(o),(v),(c))
421#define bus_space_set_region_2(t, h, o, v, c) \
422 __bs_set(sr,2,(t),(h),(o),(v),(c))
423#define bus_space_set_region_4(t, h, o, v, c) \
424 __bs_set(sr,4,(t),(h),(o),(v),(c))
425#define bus_space_set_region_8(t, h, o, v, c) \
426 __bs_set(sr,8,(t),(h),(o),(v),(c))
427
428#define bus_space_set_region_stream_1 bus_space_set_region_1
429#define bus_space_set_region_stream_2(t, h, o, v, c) \
430 __bs_set(sr,s_2,(t),(h),(o),(v),(c))
431#define bus_space_set_region_stream_4(t, h, o, v, c) \
432 __bs_set(sr,s_4,(t),(h),(o),(v),(c))
433#define bus_space_set_region_stream_8(t, h, o, v, c) \
434 __bs_set(sr,s_8,(t),(h),(o),(v),(c))
435
436#if 0
437/*
438 * Copy operations.
439 */
440#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \
441 __bs_copy(1, t, h1, o1, h2, o2, c)
442#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \
443 __bs_copy(2, t, h1, o1, h2, o2, c)
444#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \
445 __bs_copy(4, t, h1, o1, h2, o2, c)
446#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \
447 __bs_copy(8, t, h1, o1, h2, o2, c)
448
449#define bus_space_copy_region_stream_1 bus_space_copy_region_1
450#define bus_space_copy_region_stream_2(t, h1, o1, h2, o2, c) \
451 __bs_copy(s_2, t, h1, o1, h2, o2, c)
452#define bus_space_copy_region_stream_4(t, h1, o1, h2, o2, c) \
453 __bs_copy(s_4, t, h1, o1, h2, o2, c)
454#define bus_space_copy_region_stream_8(t, h1, o1, h2, o2, c) \
455 __bs_copy(s_8, t, h1, o1, h2, o2, c)
456#endif
457
458#include <machine/bus_dma.h>
459
460#endif /* _MACHINE_BUS_H_ */
90
91#define BUS_SPACE_MAP_CACHEABLE 0x01
92#define BUS_SPACE_MAP_LINEAR 0x02
93#define BUS_SPACE_MAP_PREFETCHABLE 0x04
94
95#define BUS_SPACE_UNRESTRICTED (~0)
96
97#define BUS_SPACE_BARRIER_READ 0x01
98#define BUS_SPACE_BARRIER_WRITE 0x02
99
100struct bus_space_access;
101
102struct bus_space {
103 /* mapping/unmapping */
104 int (*bs_map)(bus_addr_t, bus_size_t, int,
105 bus_space_handle_t *);
106 void (*bs_unmap)(bus_size_t);
107 int (*bs_subregion)(bus_space_handle_t, bus_size_t,
108 bus_size_t, bus_space_handle_t *);
109
110 /* allocation/deallocation */
111 int (*bs_alloc)(bus_addr_t, bus_addr_t, bus_size_t,
112 bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
113 void (*bs_free)(bus_space_handle_t, bus_size_t);
114
115 void (*bs_barrier)(bus_space_handle_t, bus_size_t,
116 bus_size_t, int);
117
118 /* Read single. */
119 uint8_t (*bs_r_1)(bus_space_handle_t, bus_size_t);
120 uint16_t (*bs_r_2)(bus_space_handle_t, bus_size_t);
121 uint32_t (*bs_r_4)(bus_space_handle_t, bus_size_t);
122 uint64_t (*bs_r_8)(bus_space_handle_t, bus_size_t);
123
124 uint16_t (*bs_r_s_2)(bus_space_handle_t, bus_size_t);
125 uint32_t (*bs_r_s_4)(bus_space_handle_t, bus_size_t);
126 uint64_t (*bs_r_s_8)(bus_space_handle_t, bus_size_t);
127
128 /* read multiple */
129 void (*bs_rm_1)(bus_space_handle_t, bus_size_t, uint8_t *,
130 bus_size_t);
131 void (*bs_rm_2)(bus_space_handle_t, bus_size_t, uint16_t *,
132 bus_size_t);
133 void (*bs_rm_4)(bus_space_handle_t, bus_size_t, uint32_t *,
134 bus_size_t);
135 void (*bs_rm_8)(bus_space_handle_t, bus_size_t, uint64_t *,
136 bus_size_t);
137
138 void (*bs_rm_s_2)(bus_space_handle_t, bus_size_t, uint16_t *,
139 bus_size_t);
140 void (*bs_rm_s_4)(bus_space_handle_t, bus_size_t, uint32_t *,
141 bus_size_t);
142 void (*bs_rm_s_8)(bus_space_handle_t, bus_size_t, uint64_t *,
143 bus_size_t);
144
145 /* read region */
146 void (*bs_rr_1)(bus_space_handle_t, bus_size_t, uint8_t *,
147 bus_size_t);
148 void (*bs_rr_2)(bus_space_handle_t, bus_size_t, uint16_t *,
149 bus_size_t);
150 void (*bs_rr_4)(bus_space_handle_t, bus_size_t, uint32_t *,
151 bus_size_t);
152 void (*bs_rr_8)(bus_space_handle_t, bus_size_t, uint64_t *,
153 bus_size_t);
154
155 void (*bs_rr_s_2)(bus_space_handle_t, bus_size_t, uint16_t *,
156 bus_size_t);
157 void (*bs_rr_s_4)(bus_space_handle_t, bus_size_t, uint32_t *,
158 bus_size_t);
159 void (*bs_rr_s_8)(bus_space_handle_t, bus_size_t, uint64_t *,
160 bus_size_t);
161
162 /* write */
163 void (*bs_w_1)(bus_space_handle_t, bus_size_t, uint8_t);
164 void (*bs_w_2)(bus_space_handle_t, bus_size_t, uint16_t);
165 void (*bs_w_4)(bus_space_handle_t, bus_size_t, uint32_t);
166 void (*bs_w_8)(bus_space_handle_t, bus_size_t, uint64_t);
167
168 void (*bs_w_s_2)(bus_space_handle_t, bus_size_t, uint16_t);
169 void (*bs_w_s_4)(bus_space_handle_t, bus_size_t, uint32_t);
170 void (*bs_w_s_8)(bus_space_handle_t, bus_size_t, uint64_t);
171
172 /* write multiple */
173 void (*bs_wm_1)(bus_space_handle_t, bus_size_t,
174 const uint8_t *, bus_size_t);
175 void (*bs_wm_2)(bus_space_handle_t, bus_size_t,
176 const uint16_t *, bus_size_t);
177 void (*bs_wm_4)(bus_space_handle_t, bus_size_t,
178 const uint32_t *, bus_size_t);
179 void (*bs_wm_8)(bus_space_handle_t, bus_size_t,
180 const uint64_t *, bus_size_t);
181
182 void (*bs_wm_s_2)(bus_space_handle_t, bus_size_t,
183 const uint16_t *, bus_size_t);
184 void (*bs_wm_s_4)(bus_space_handle_t, bus_size_t,
185 const uint32_t *, bus_size_t);
186 void (*bs_wm_s_8)(bus_space_handle_t, bus_size_t,
187 const uint64_t *, bus_size_t);
188
189 /* write region */
190 void (*bs_wr_1)(bus_space_handle_t, bus_size_t,
191 const uint8_t *, bus_size_t);
192 void (*bs_wr_2)(bus_space_handle_t, bus_size_t,
193 const uint16_t *, bus_size_t);
194 void (*bs_wr_4)(bus_space_handle_t, bus_size_t,
195 const uint32_t *, bus_size_t);
196 void (*bs_wr_8)(bus_space_handle_t, bus_size_t,
197 const uint64_t *, bus_size_t);
198
199 void (*bs_wr_s_2)(bus_space_handle_t, bus_size_t,
200 const uint16_t *, bus_size_t);
201 void (*bs_wr_s_4)(bus_space_handle_t, bus_size_t,
202 const uint32_t *, bus_size_t);
203 void (*bs_wr_s_8)(bus_space_handle_t, bus_size_t,
204 const uint64_t *, bus_size_t);
205
206 /* set multiple */
207 void (*bs_sm_1)(bus_space_handle_t, bus_size_t, uint8_t,
208 bus_size_t);
209 void (*bs_sm_2)(bus_space_handle_t, bus_size_t, uint16_t,
210 bus_size_t);
211 void (*bs_sm_4)(bus_space_handle_t, bus_size_t, uint32_t,
212 bus_size_t);
213 void (*bs_sm_8)(bus_space_handle_t, bus_size_t, uint64_t,
214 bus_size_t);
215
216 void (*bs_sm_s_2)(bus_space_handle_t, bus_size_t, uint16_t,
217 bus_size_t);
218 void (*bs_sm_s_4)(bus_space_handle_t, bus_size_t, uint32_t,
219 bus_size_t);
220 void (*bs_sm_s_8)(bus_space_handle_t, bus_size_t, uint64_t,
221 bus_size_t);
222
223 /* set region */
224 void (*bs_sr_1)(bus_space_handle_t, bus_size_t, uint8_t,
225 bus_size_t);
226 void (*bs_sr_2)(bus_space_handle_t, bus_size_t, uint16_t,
227 bus_size_t);
228 void (*bs_sr_4)(bus_space_handle_t, bus_size_t, uint32_t,
229 bus_size_t);
230 void (*bs_sr_8)(bus_space_handle_t, bus_size_t, uint64_t,
231 bus_size_t);
232
233 void (*bs_sr_s_2)(bus_space_handle_t, bus_size_t, uint16_t,
234 bus_size_t);
235 void (*bs_sr_s_4)(bus_space_handle_t, bus_size_t, uint32_t,
236 bus_size_t);
237 void (*bs_sr_s_8)(bus_space_handle_t, bus_size_t, uint64_t,
238 bus_size_t);
239
240 /* copy region */
241 void (*bs_cr_1)(bus_space_handle_t, bus_size_t,
242 bus_space_handle_t, bus_size_t, bus_size_t);
243 void (*bs_cr_2)(bus_space_handle_t, bus_size_t,
244 bus_space_handle_t, bus_size_t, bus_size_t);
245 void (*bs_cr_4)(bus_space_handle_t, bus_size_t,
246 bus_space_handle_t, bus_size_t, bus_size_t);
247 void (*bs_cr_8)(bus_space_handle_t, bus_size_t,
248 bus_space_handle_t, bus_size_t, bus_size_t);
249
250 void (*bs_cr_s_2)(bus_space_handle_t, bus_size_t,
251 bus_space_handle_t, bus_size_t, bus_size_t);
252 void (*bs_cr_s_4)(bus_space_handle_t, bus_size_t,
253 bus_space_handle_t, bus_size_t, bus_size_t);
254 void (*bs_cr_s_8)(bus_space_handle_t, bus_size_t,
255 bus_space_handle_t, bus_size_t, bus_size_t);
256};
257
258extern struct bus_space bs_be_tag;
259extern struct bus_space bs_le_tag;
260
261#define __bs_c(a,b) __CONCAT(a,b)
262#define __bs_opname(op,size) __bs_c(__bs_c(__bs_c(bs_,op),_),size)
263
264#define __bs_rs(sz, t, h, o) \
265 (*(t)->__bs_opname(r,sz))(h, o)
266#define __bs_ws(sz, t, h, o, v) \
267 (*(t)->__bs_opname(w,sz))(h, o, v)
268#define __bs_nonsingle(type, sz, t, h, o, a, c) \
269 (*(t)->__bs_opname(type,sz))(h, o, a, c)
270#define __bs_set(type, sz, t, h, o, v, c) \
271 (*(t)->__bs_opname(type,sz))(h, o, v, c)
272#define __bs_copy(sz, t, h1, o1, h2, o2, cnt) \
273 (*(t)->__bs_opname(c,sz))(h1, o1, h2, o2, cnt)
274
275/*
276 * Mapping and unmapping operations.
277 */
278#define bus_space_map(t, a, s, c, hp) (*(t)->bs_map)(a, s, c, hp)
279#define bus_space_unmap(t, h, s) (*(t)->bs_unmap)(h, s)
280#define bus_space_subregion(t, h, o, s, hp) (*(t)->bs_subregion)(h, o, s, hp)
281
282/*
283 * Allocation and deallocation operations.
284 */
285#define bus_space_alloc(t, rs, re, s, a, b, c, ap, hp) \
286 (*(t)->bs_alloc)(rs, re, s, a, b, c, ap, hp)
287#define bus_space_free(t, h, s) \
288 (*(t)->bs_free)(h, s)
289
290/*
291 * Bus barrier operations.
292 */
293#define bus_space_barrier(t, h, o, l, f) (*(t)->bs_barrier)(h, o, l, f)
294
295/*
296 * Bus read (single) operations.
297 */
298#define bus_space_read_1(t, h, o) __bs_rs(1,t,h,o)
299#define bus_space_read_2(t, h, o) __bs_rs(2,t,h,o)
300#define bus_space_read_4(t, h, o) __bs_rs(4,t,h,o)
301#define bus_space_read_8(t, h, o) __bs_rs(8,t,h,o)
302
303#define bus_space_read_stream_1 bus_space_read_1
304#define bus_space_read_stream_2(t, h, o) __bs_rs(s_2,t,h,o)
305#define bus_space_read_stream_4(t, h, o) __bs_rs(s_4,t,h,o)
306#define bus_space_read_stream_8(t, h, o) __bs_rs(s_8,t,h,o)
307
308/*
309 * Bus read multiple operations.
310 */
311#define bus_space_read_multi_1(t, h, o, a, c) \
312 __bs_nonsingle(rm,1,(t),(h),(o),(a),(c))
313#define bus_space_read_multi_2(t, h, o, a, c) \
314 __bs_nonsingle(rm,2,(t),(h),(o),(a),(c))
315#define bus_space_read_multi_4(t, h, o, a, c) \
316 __bs_nonsingle(rm,4,(t),(h),(o),(a),(c))
317#define bus_space_read_multi_8(t, h, o, a, c) \
318 __bs_nonsingle(rm,8,(t),(h),(o),(a),(c))
319
320#define bus_space_read_multi_stream_1 bus_space_read_multi_1
321#define bus_space_read_multi_stream_2(t, h, o, a, c) \
322 __bs_nonsingle(rm,s_2,(t),(h),(o),(a),(c))
323#define bus_space_read_multi_stream_4(t, h, o, a, c) \
324 __bs_nonsingle(rm,s_4,(t),(h),(o),(a),(c))
325#define bus_space_read_multi_stream_8(t, h, o, a, c) \
326 __bs_nonsingle(rm,s_8,(t),(h),(o),(a),(c))
327
328/*
329 * Bus read region operations.
330 */
331#define bus_space_read_region_1(t, h, o, a, c) \
332 __bs_nonsingle(rr,1,(t),(h),(o),(a),(c))
333#define bus_space_read_region_2(t, h, o, a, c) \
334 __bs_nonsingle(rr,2,(t),(h),(o),(a),(c))
335#define bus_space_read_region_4(t, h, o, a, c) \
336 __bs_nonsingle(rr,4,(t),(h),(o),(a),(c))
337#define bus_space_read_region_8(t, h, o, a, c) \
338 __bs_nonsingle(rr,8,(t),(h),(o),(a),(c))
339
340#define bus_space_read_region_stream_1 bus_space_read_region_1
341#define bus_space_read_region_stream_2(t, h, o, a, c) \
342 __bs_nonsingle(rr,s_2,(t),(h),(o),(a),(c))
343#define bus_space_read_region_stream_4(t, h, o, a, c) \
344 __bs_nonsingle(rr,s_4,(t),(h),(o),(a),(c))
345#define bus_space_read_region_stream_8(t, h, o, a, c) \
346 __bs_nonsingle(rr,s_8,(t),(h),(o),(a),(c))
347
348/*
349 * Bus write (single) operations.
350 */
351#define bus_space_write_1(t, h, o, v) __bs_ws(1,(t),(h),(o),(v))
352#define bus_space_write_2(t, h, o, v) __bs_ws(2,(t),(h),(o),(v))
353#define bus_space_write_4(t, h, o, v) __bs_ws(4,(t),(h),(o),(v))
354#define bus_space_write_8(t, h, o, v) __bs_ws(8,(t),(h),(o),(v))
355
356#define bus_space_write_stream_1 bus_space_write_1
357#define bus_space_write_stream_2(t, h, o, v) __bs_ws(s_2,(t),(h),(o),(v))
358#define bus_space_write_stream_4(t, h, o, v) __bs_ws(s_4,(t),(h),(o),(v))
359#define bus_space_write_stream_8(t, h, o, v) __bs_ws(s_8,(t),(h),(o),(v))
360
361/*
362 * Bus write multiple operations.
363 */
364#define bus_space_write_multi_1(t, h, o, a, c) \
365 __bs_nonsingle(wm,1,(t),(h),(o),(a),(c))
366#define bus_space_write_multi_2(t, h, o, a, c) \
367 __bs_nonsingle(wm,2,(t),(h),(o),(a),(c))
368#define bus_space_write_multi_4(t, h, o, a, c) \
369 __bs_nonsingle(wm,4,(t),(h),(o),(a),(c))
370#define bus_space_write_multi_8(t, h, o, a, c) \
371 __bs_nonsingle(wm,8,(t),(h),(o),(a),(c))
372
373#define bus_space_write_multi_stream_1 bus_space_write_multi_1
374#define bus_space_write_multi_stream_2(t, h, o, a, c) \
375 __bs_nonsingle(wm,s_2,(t),(h),(o),(a),(c))
376#define bus_space_write_multi_stream_4(t, h, o, a, c) \
377 __bs_nonsingle(wm,s_4,(t),(h),(o),(a),(c))
378#define bus_space_write_multi_stream_8(t, h, o, a, c) \
379 __bs_nonsingle(wm,s_8,(t),(h),(o),(a),(c))
380
381/*
382 * Bus write region operations.
383 */
384#define bus_space_write_region_1(t, h, o, a, c) \
385 __bs_nonsingle(wr,1,(t),(h),(o),(a),(c))
386#define bus_space_write_region_2(t, h, o, a, c) \
387 __bs_nonsingle(wr,2,(t),(h),(o),(a),(c))
388#define bus_space_write_region_4(t, h, o, a, c) \
389 __bs_nonsingle(wr,4,(t),(h),(o),(a),(c))
390#define bus_space_write_region_8(t, h, o, a, c) \
391 __bs_nonsingle(wr,8,(t),(h),(o),(a),(c))
392
393#define bus_space_write_region_stream_1 bus_space_write_region_1
394#define bus_space_write_region_stream_2(t, h, o, a, c) \
395 __bs_nonsingle(wr,s_2,(t),(h),(o),(a),(c))
396#define bus_space_write_region_stream_4(t, h, o, a, c) \
397 __bs_nonsingle(wr,s_4,(t),(h),(o),(a),(c))
398#define bus_space_write_region_stream_8(t, h, o, a, c) \
399 __bs_nonsingle(wr,s_8,(t),(h),(o),(a),(c))
400
401/*
402 * Set multiple operations.
403 */
404#define bus_space_set_multi_1(t, h, o, v, c) \
405 __bs_set(sm,1,(t),(h),(o),(v),(c))
406#define bus_space_set_multi_2(t, h, o, v, c) \
407 __bs_set(sm,2,(t),(h),(o),(v),(c))
408#define bus_space_set_multi_4(t, h, o, v, c) \
409 __bs_set(sm,4,(t),(h),(o),(v),(c))
410#define bus_space_set_multi_8(t, h, o, v, c) \
411 __bs_set(sm,8,(t),(h),(o),(v),(c))
412
413#define bus_space_set_multi_stream_1 bus_space_set_multi_1
414#define bus_space_set_multi_stream_2(t, h, o, v, c) \
415 __bs_set(sm,s_2,(t),(h),(o),(v),(c))
416#define bus_space_set_multi_stream_4(t, h, o, v, c) \
417 __bs_set(sm,s_4,(t),(h),(o),(v),(c))
418#define bus_space_set_multi_stream_8(t, h, o, v, c) \
419 __bs_set(sm,s_8,(t),(h),(o),(v),(c))
420
421/*
422 * Set region operations.
423 */
424#define bus_space_set_region_1(t, h, o, v, c) \
425 __bs_set(sr,1,(t),(h),(o),(v),(c))
426#define bus_space_set_region_2(t, h, o, v, c) \
427 __bs_set(sr,2,(t),(h),(o),(v),(c))
428#define bus_space_set_region_4(t, h, o, v, c) \
429 __bs_set(sr,4,(t),(h),(o),(v),(c))
430#define bus_space_set_region_8(t, h, o, v, c) \
431 __bs_set(sr,8,(t),(h),(o),(v),(c))
432
433#define bus_space_set_region_stream_1 bus_space_set_region_1
434#define bus_space_set_region_stream_2(t, h, o, v, c) \
435 __bs_set(sr,s_2,(t),(h),(o),(v),(c))
436#define bus_space_set_region_stream_4(t, h, o, v, c) \
437 __bs_set(sr,s_4,(t),(h),(o),(v),(c))
438#define bus_space_set_region_stream_8(t, h, o, v, c) \
439 __bs_set(sr,s_8,(t),(h),(o),(v),(c))
440
441#if 0
442/*
443 * Copy operations.
444 */
445#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \
446 __bs_copy(1, t, h1, o1, h2, o2, c)
447#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \
448 __bs_copy(2, t, h1, o1, h2, o2, c)
449#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \
450 __bs_copy(4, t, h1, o1, h2, o2, c)
451#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \
452 __bs_copy(8, t, h1, o1, h2, o2, c)
453
454#define bus_space_copy_region_stream_1 bus_space_copy_region_1
455#define bus_space_copy_region_stream_2(t, h1, o1, h2, o2, c) \
456 __bs_copy(s_2, t, h1, o1, h2, o2, c)
457#define bus_space_copy_region_stream_4(t, h1, o1, h2, o2, c) \
458 __bs_copy(s_4, t, h1, o1, h2, o2, c)
459#define bus_space_copy_region_stream_8(t, h1, o1, h2, o2, c) \
460 __bs_copy(s_8, t, h1, o1, h2, o2, c)
461#endif
462
463#include <machine/bus_dma.h>
464
465#endif /* _MACHINE_BUS_H_ */