xref: /netbsd/sys/arch/mips/include/bus_space_funcs.h (revision 19d1a3a3)
1*19d1a3a3Ssimonb /*	$NetBSD: bus_space_funcs.h,v 1.2 2020/07/26 08:08:41 simonb Exp $	*/
29c914b73Sdyoung 
39c914b73Sdyoung /*-
49c914b73Sdyoung  * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc.
59c914b73Sdyoung  * All rights reserved.
69c914b73Sdyoung  *
79c914b73Sdyoung  * This code is derived from software contributed to The NetBSD Foundation
89c914b73Sdyoung  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
99c914b73Sdyoung  * NASA Ames Research Center.
109c914b73Sdyoung  *
119c914b73Sdyoung  * Redistribution and use in source and binary forms, with or without
129c914b73Sdyoung  * modification, are permitted provided that the following conditions
139c914b73Sdyoung  * are met:
149c914b73Sdyoung  * 1. Redistributions of source code must retain the above copyright
159c914b73Sdyoung  *    notice, this list of conditions and the following disclaimer.
169c914b73Sdyoung  * 2. Redistributions in binary form must reproduce the above copyright
179c914b73Sdyoung  *    notice, this list of conditions and the following disclaimer in the
189c914b73Sdyoung  *    documentation and/or other materials provided with the distribution.
199c914b73Sdyoung  *
209c914b73Sdyoung  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
219c914b73Sdyoung  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
229c914b73Sdyoung  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
239c914b73Sdyoung  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
249c914b73Sdyoung  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
259c914b73Sdyoung  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
269c914b73Sdyoung  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
279c914b73Sdyoung  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
289c914b73Sdyoung  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
299c914b73Sdyoung  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
309c914b73Sdyoung  * POSSIBILITY OF SUCH DAMAGE.
319c914b73Sdyoung  */
329c914b73Sdyoung 
339c914b73Sdyoung /*
349c914b73Sdyoung  * Copyright (c) 1996 Carnegie-Mellon University.
359c914b73Sdyoung  * All rights reserved.
369c914b73Sdyoung  *
379c914b73Sdyoung  * Author: Chris G. Demetriou
389c914b73Sdyoung  *
399c914b73Sdyoung  * Permission to use, copy, modify and distribute this software and
409c914b73Sdyoung  * its documentation is hereby granted, provided that both the copyright
419c914b73Sdyoung  * notice and this permission notice appear in all copies of the
429c914b73Sdyoung  * software, derivative works or modified versions, and any portions
439c914b73Sdyoung  * thereof, and that both notices appear in supporting documentation.
449c914b73Sdyoung  *
459c914b73Sdyoung  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
469c914b73Sdyoung  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
479c914b73Sdyoung  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
489c914b73Sdyoung  *
499c914b73Sdyoung  * Carnegie Mellon requests users of this software to return to
509c914b73Sdyoung  *
519c914b73Sdyoung  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
529c914b73Sdyoung  *  School of Computer Science
539c914b73Sdyoung  *  Carnegie Mellon University
549c914b73Sdyoung  *  Pittsburgh PA 15213-3890
559c914b73Sdyoung  *
569c914b73Sdyoung  * any improvements or extensions that they make and grant Carnegie the
579c914b73Sdyoung  * rights to redistribute these changes.
589c914b73Sdyoung  */
599c914b73Sdyoung 
609c914b73Sdyoung #ifndef _MIPS_BUS_SPACE_FUNCS_H_
619c914b73Sdyoung #define	_MIPS_BUS_SPACE_FUNCS_H_
629c914b73Sdyoung 
639c914b73Sdyoung #ifdef _KERNEL
649c914b73Sdyoung /*
659c914b73Sdyoung  * Utility macros; INTERNAL USE ONLY.
669c914b73Sdyoung  */
679c914b73Sdyoung #define	__bs_c(a,b)		__CONCAT(a,b)
689c914b73Sdyoung #define	__bs_opname(op,size)	__bs_c(__bs_c(__bs_c(bs_,op),_),size)
699c914b73Sdyoung 
709c914b73Sdyoung #define	__bs_r(type, sz, tn, t, h, o)					\
719c914b73Sdyoung 	(__BUS_SPACE_ADDRESS_SANITY((h) + (o), tn, "bus addr"),		\
729c914b73Sdyoung 	 (*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o))
739c914b73Sdyoung 
749c914b73Sdyoung #define	__bs_w(type, sz, tn, t, h, o, v)				\
759c914b73Sdyoung do {									\
769c914b73Sdyoung 	__BUS_SPACE_ADDRESS_SANITY((h) + (o), tn, "bus addr");		\
779c914b73Sdyoung 	(*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, v);		\
789c914b73Sdyoung } while (0)
799c914b73Sdyoung 
809c914b73Sdyoung #define	__bs_nonsingle(type, sz, tn, t, h, o, a, c)			\
819c914b73Sdyoung do {									\
829c914b73Sdyoung 	__BUS_SPACE_ADDRESS_SANITY((a), tn, "buffer");			\
839c914b73Sdyoung 	__BUS_SPACE_ADDRESS_SANITY((h) + (o), tn, "bus addr");		\
849c914b73Sdyoung 	(*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, a, c);	\
859c914b73Sdyoung } while (0)
869c914b73Sdyoung 
879c914b73Sdyoung #define	__bs_set(type, sz, tn, t, h, o, v, c)				\
889c914b73Sdyoung do {									\
899c914b73Sdyoung 	__BUS_SPACE_ADDRESS_SANITY((h) + (o), tn, "bus addr");		\
909c914b73Sdyoung 	(*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, v, c);	\
919c914b73Sdyoung } while (0)
929c914b73Sdyoung 
939c914b73Sdyoung #define	__bs_copy(sz, tn, t, h1, o1, h2, o2, cnt)			\
949c914b73Sdyoung do {									\
959c914b73Sdyoung 	__BUS_SPACE_ADDRESS_SANITY((h1) + (o1), tn, "bus addr 1");	\
969c914b73Sdyoung 	__BUS_SPACE_ADDRESS_SANITY((h2) + (o2), tn, "bus addr 2");	\
979c914b73Sdyoung 	(*(t)->__bs_opname(c,sz))((t)->bs_cookie, h1, o1, h2, o2, cnt); \
989c914b73Sdyoung } while (0)
999c914b73Sdyoung 
1009c914b73Sdyoung 
1019c914b73Sdyoung /*
1029c914b73Sdyoung  * Mapping and unmapping operations.
1039c914b73Sdyoung  */
1049c914b73Sdyoung #define	bus_space_map(t, a, s, f, hp)					\
1059c914b73Sdyoung 	(*(t)->bs_map)((t)->bs_cookie, (a), (s), (f), (hp), 1)
1069c914b73Sdyoung #define	mips_bus_space_map_noacct(t, a, s, f, hp)			\
1079c914b73Sdyoung 	(*(t)->bs_map)((t)->bs_cookie, (a), (s), (f), (hp), 0)
1089c914b73Sdyoung #define	bus_space_unmap(t, h, s)					\
1099c914b73Sdyoung 	(*(t)->bs_unmap)((t)->bs_cookie, (h), (s), 1)
1109c914b73Sdyoung #define	mips_bus_space_unmap_noacct(t, h, s)				\
1119c914b73Sdyoung 	(*(t)->bs_unmap)((t)->bs_cookie, (h), (s), 0)
1129c914b73Sdyoung #define	bus_space_subregion(t, h, o, s, hp)				\
1139c914b73Sdyoung 	(*(t)->bs_subregion)((t)->bs_cookie, (h), (o), (s), (hp))
1149c914b73Sdyoung 
1159c914b73Sdyoung #define	mips_bus_space_translate(t, a, s, f, bst)			\
1169c914b73Sdyoung 	(*(t)->bs_translate)((t)->bs_cookie, (a), (s), (f), (bst))
1179c914b73Sdyoung #define	mips_bus_space_get_window(t, w, bst)				\
1189c914b73Sdyoung 	(*(t)->bs_get_window)((t)->bs_cookie, (w), (bst))
1199c914b73Sdyoung 
1209c914b73Sdyoung /*
1219c914b73Sdyoung  * Allocation and deallocation operations.
1229c914b73Sdyoung  */
1239c914b73Sdyoung #define	bus_space_alloc(t, rs, re, s, a, b, f, ap, hp)			\
1249c914b73Sdyoung 	(*(t)->bs_alloc)((t)->bs_cookie, (rs), (re), (s), (a), (b),	\
1259c914b73Sdyoung 	    (f), (ap), (hp))
1269c914b73Sdyoung #define	bus_space_free(t, h, s)						\
1279c914b73Sdyoung 	(*(t)->bs_free)((t)->bs_cookie, (h), (s))
1289c914b73Sdyoung 
1299c914b73Sdyoung /*
1309c914b73Sdyoung  * Get kernel virtual address for ranges mapped BUS_SPACE_MAP_LINEAR.
1319c914b73Sdyoung  */
1329c914b73Sdyoung #define	bus_space_vaddr(t, h) \
1339c914b73Sdyoung 	(*(t)->bs_vaddr)((t)->bs_cookie, (h))
1349c914b73Sdyoung 
1359c914b73Sdyoung /*
1369c914b73Sdyoung  * Mmap bus space for a user application.
1379c914b73Sdyoung  */
1389c914b73Sdyoung #define	bus_space_mmap(t, a, o, p, f)					\
1399c914b73Sdyoung 	(*(t)->bs_mmap)((t)->bs_cookie, (a), (o), (p), (f))
1409c914b73Sdyoung 
1419c914b73Sdyoung /*
1429c914b73Sdyoung  * Bus barrier operations.
1439c914b73Sdyoung  */
1449c914b73Sdyoung #define	bus_space_barrier(t, h, o, l, f)				\
1459c914b73Sdyoung 	(*(t)->bs_barrier)((t)->bs_cookie, (h), (o), (l), (f))
1469c914b73Sdyoung 
1479c914b73Sdyoung /*
1489c914b73Sdyoung  * Bus read (single) operations.
1499c914b73Sdyoung  */
1509c914b73Sdyoung #define	bus_space_read_1(t, h, o)					\
1519c914b73Sdyoung 	__bs_r(r,1,uint8_t,(t),(h),(o))
1529c914b73Sdyoung #define	bus_space_read_2(t, h, o)					\
1539c914b73Sdyoung 	__bs_r(r,2,uint16_t,(t),(h),(o))
1549c914b73Sdyoung #define	bus_space_read_4(t, h, o)					\
1559c914b73Sdyoung 	__bs_r(r,4,uint32_t,(t),(h),(o))
1569c914b73Sdyoung #define	bus_space_read_8(t, h, o)					\
1579c914b73Sdyoung 	__bs_r(r,8,uint64_t,(t),(h),(o))
1589c914b73Sdyoung #define	bus_space_read_stream_1(t, h, o)				\
1599c914b73Sdyoung 	__bs_r(rs,1,uint8_t,(t),(h),(o))
1609c914b73Sdyoung #define	bus_space_read_stream_2(t, h, o)				\
1619c914b73Sdyoung 	__bs_r(rs,2,uint16_t,(t),(h),(o))
1629c914b73Sdyoung #define	bus_space_read_stream_4(t, h, o)				\
1639c914b73Sdyoung 	__bs_r(rs,4,uint32_t,(t),(h),(o))
1649c914b73Sdyoung #define	bus_space_read_stream_8(t, h, o)				\
1659c914b73Sdyoung 	__bs_r(rs,8,uint64_t,(t),(h),(o))
1669c914b73Sdyoung 
1679c914b73Sdyoung 
1689c914b73Sdyoung /*
1699c914b73Sdyoung  * Bus read multiple operations.
1709c914b73Sdyoung  */
1719c914b73Sdyoung #define	bus_space_read_multi_1(t, h, o, a, c)				\
1729c914b73Sdyoung 	__bs_nonsingle(rm,1,uint8_t,(t),(h),(o),(a),(c))
1739c914b73Sdyoung #define	bus_space_read_multi_2(t, h, o, a, c)				\
1749c914b73Sdyoung 	__bs_nonsingle(rm,2,uint16_t,(t),(h),(o),(a),(c))
1759c914b73Sdyoung #define	bus_space_read_multi_4(t, h, o, a, c)				\
1769c914b73Sdyoung 	__bs_nonsingle(rm,4,uint32_t,(t),(h),(o),(a),(c))
1779c914b73Sdyoung #define	bus_space_read_multi_8(t, h, o, a, c)				\
1789c914b73Sdyoung 	__bs_nonsingle(rm,8,uint64_t,(t),(h),(o),(a),(c))
1799c914b73Sdyoung #define	bus_space_read_multi_stream_1(t, h, o, a, c)			\
1809c914b73Sdyoung 	__bs_nonsingle(rms,1,uint8_t,(t),(h),(o),(a),(c))
1819c914b73Sdyoung #define	bus_space_read_multi_stream_2(t, h, o, a, c)			\
1829c914b73Sdyoung 	__bs_nonsingle(rms,2,uint16_t,(t),(h),(o),(a),(c))
1839c914b73Sdyoung #define	bus_space_read_multi_stream_4(t, h, o, a, c)			\
1849c914b73Sdyoung 	__bs_nonsingle(rms,4,uint32_t,(t),(h),(o),(a),(c))
1859c914b73Sdyoung #define	bus_space_read_multi_stream_8(t, h, o, a, c)			\
1869c914b73Sdyoung 	__bs_nonsingle(rms,8,uint64_t,(t),(h),(o),(a),(c))
1879c914b73Sdyoung 
1889c914b73Sdyoung 
1899c914b73Sdyoung /*
1909c914b73Sdyoung  * Bus read region operations.
1919c914b73Sdyoung  */
1929c914b73Sdyoung #define	bus_space_read_region_1(t, h, o, a, c)				\
1939c914b73Sdyoung 	__bs_nonsingle(rr,1,uint8_t,(t),(h),(o),(a),(c))
1949c914b73Sdyoung #define	bus_space_read_region_2(t, h, o, a, c)				\
1959c914b73Sdyoung 	__bs_nonsingle(rr,2,uint16_t,(t),(h),(o),(a),(c))
1969c914b73Sdyoung #define	bus_space_read_region_4(t, h, o, a, c)				\
1979c914b73Sdyoung 	__bs_nonsingle(rr,4,uint32_t,(t),(h),(o),(a),(c))
1989c914b73Sdyoung #define	bus_space_read_region_8(t, h, o, a, c)				\
1999c914b73Sdyoung 	__bs_nonsingle(rr,8,uint64_t,(t),(h),(o),(a),(c))
2009c914b73Sdyoung #define	bus_space_read_region_stream_1(t, h, o, a, c)			\
2019c914b73Sdyoung 	__bs_nonsingle(rrs,1,uint8_t,(t),(h),(o),(a),(c))
2029c914b73Sdyoung #define	bus_space_read_region_stream_2(t, h, o, a, c)			\
2039c914b73Sdyoung 	__bs_nonsingle(rrs,2,uint16_t,(t),(h),(o),(a),(c))
2049c914b73Sdyoung #define	bus_space_read_region_stream_4(t, h, o, a, c)			\
2059c914b73Sdyoung 	__bs_nonsingle(rrs,4,uint32_t,(t),(h),(o),(a),(c))
2069c914b73Sdyoung #define	bus_space_read_region_stream_8(t, h, o, a, c)			\
2079c914b73Sdyoung 	__bs_nonsingle(rrs,8,uint64_t,(t),(h),(o),(a),(c))
2089c914b73Sdyoung 
2099c914b73Sdyoung 
2109c914b73Sdyoung /*
2119c914b73Sdyoung  * Bus write (single) operations.
2129c914b73Sdyoung  */
2139c914b73Sdyoung #define	bus_space_write_1(t, h, o, v)					\
2149c914b73Sdyoung 	__bs_w(w,1,uint8_t,(t),(h),(o),(v))
2159c914b73Sdyoung #define	bus_space_write_2(t, h, o, v)					\
2169c914b73Sdyoung 	__bs_w(w,2,uint16_t,(t),(h),(o),(v))
2179c914b73Sdyoung #define	bus_space_write_4(t, h, o, v)					\
2189c914b73Sdyoung 	__bs_w(w,4,uint32_t,(t),(h),(o),(v))
2199c914b73Sdyoung #define	bus_space_write_8(t, h, o, v)					\
2209c914b73Sdyoung 	__bs_w(w,8,uint64_t,(t),(h),(o),(v))
2219c914b73Sdyoung #define	bus_space_write_stream_1(t, h, o, v)				\
2229c914b73Sdyoung 	__bs_w(ws,1,uint8_t,(t),(h),(o),(v))
2239c914b73Sdyoung #define	bus_space_write_stream_2(t, h, o, v)				\
2249c914b73Sdyoung 	__bs_w(ws,2,uint16_t,(t),(h),(o),(v))
2259c914b73Sdyoung #define	bus_space_write_stream_4(t, h, o, v)				\
2269c914b73Sdyoung 	__bs_w(ws,4,uint32_t,(t),(h),(o),(v))
2279c914b73Sdyoung #define	bus_space_write_stream_8(t, h, o, v)				\
2289c914b73Sdyoung 	__bs_w(ws,8,uint64_t,(t),(h),(o),(v))
2299c914b73Sdyoung 
2309c914b73Sdyoung 
2319c914b73Sdyoung /*
2329c914b73Sdyoung  * Bus write multiple operations.
2339c914b73Sdyoung  */
2349c914b73Sdyoung #define	bus_space_write_multi_1(t, h, o, a, c)				\
2359c914b73Sdyoung 	__bs_nonsingle(wm,1,uint8_t,(t),(h),(o),(a),(c))
2369c914b73Sdyoung #define	bus_space_write_multi_2(t, h, o, a, c)				\
2379c914b73Sdyoung 	__bs_nonsingle(wm,2,uint16_t,(t),(h),(o),(a),(c))
2389c914b73Sdyoung #define	bus_space_write_multi_4(t, h, o, a, c)				\
2399c914b73Sdyoung 	__bs_nonsingle(wm,4,uint32_t,(t),(h),(o),(a),(c))
2409c914b73Sdyoung #define	bus_space_write_multi_8(t, h, o, a, c)				\
2419c914b73Sdyoung 	__bs_nonsingle(wm,8,uint64_t,(t),(h),(o),(a),(c))
2429c914b73Sdyoung #define	bus_space_write_multi_stream_1(t, h, o, a, c)			\
2439c914b73Sdyoung 	__bs_nonsingle(wms,1,uint8_t,(t),(h),(o),(a),(c))
2449c914b73Sdyoung #define	bus_space_write_multi_stream_2(t, h, o, a, c)			\
2459c914b73Sdyoung 	__bs_nonsingle(wms,2,uint16_t,(t),(h),(o),(a),(c))
2469c914b73Sdyoung #define	bus_space_write_multi_stream_4(t, h, o, a, c)			\
2479c914b73Sdyoung 	__bs_nonsingle(wms,4,uint32_t,(t),(h),(o),(a),(c))
2489c914b73Sdyoung #define	bus_space_write_multi_stream_8(t, h, o, a, c)			\
2499c914b73Sdyoung 	__bs_nonsingle(wms,8,uint64_t,(t),(h),(o),(a),(c))
2509c914b73Sdyoung 
2519c914b73Sdyoung 
2529c914b73Sdyoung /*
2539c914b73Sdyoung  * Bus write region operations.
2549c914b73Sdyoung  */
2559c914b73Sdyoung #define	bus_space_write_region_1(t, h, o, a, c)				\
2569c914b73Sdyoung 	__bs_nonsingle(wr,1,uint8_t,(t),(h),(o),(a),(c))
2579c914b73Sdyoung #define	bus_space_write_region_2(t, h, o, a, c)				\
2589c914b73Sdyoung 	__bs_nonsingle(wr,2,uint16_t,(t),(h),(o),(a),(c))
2599c914b73Sdyoung #define	bus_space_write_region_4(t, h, o, a, c)				\
2609c914b73Sdyoung 	__bs_nonsingle(wr,4,uint32_t,(t),(h),(o),(a),(c))
2619c914b73Sdyoung #define	bus_space_write_region_8(t, h, o, a, c)				\
2629c914b73Sdyoung 	__bs_nonsingle(wr,8,uint64_t,(t),(h),(o),(a),(c))
2639c914b73Sdyoung #define	bus_space_write_region_stream_1(t, h, o, a, c)			\
2649c914b73Sdyoung 	__bs_nonsingle(wrs,1,uint8_t,(t),(h),(o),(a),(c))
2659c914b73Sdyoung #define	bus_space_write_region_stream_2(t, h, o, a, c)			\
2669c914b73Sdyoung 	__bs_nonsingle(wrs,2,uint16_t,(t),(h),(o),(a),(c))
2679c914b73Sdyoung #define	bus_space_write_region_stream_4(t, h, o, a, c)			\
2689c914b73Sdyoung 	__bs_nonsingle(wrs,4,uint32_t,(t),(h),(o),(a),(c))
2699c914b73Sdyoung #define	bus_space_write_region_stream_8(t, h, o, a, c)			\
2709c914b73Sdyoung 	__bs_nonsingle(wrs,8,uint64_t,(t),(h),(o),(a),(c))
2719c914b73Sdyoung 
2729c914b73Sdyoung 
2739c914b73Sdyoung /*
2749c914b73Sdyoung  * Set multiple operations.
2759c914b73Sdyoung  */
2769c914b73Sdyoung #define	bus_space_set_multi_1(t, h, o, v, c)				\
2779c914b73Sdyoung 	__bs_set(sm,1,uint8_t,(t),(h),(o),(v),(c))
2789c914b73Sdyoung #define	bus_space_set_multi_2(t, h, o, v, c)				\
2799c914b73Sdyoung 	__bs_set(sm,2,uint16_t,(t),(h),(o),(v),(c))
2809c914b73Sdyoung #define	bus_space_set_multi_4(t, h, o, v, c)				\
2819c914b73Sdyoung 	__bs_set(sm,4,uint32_t,(t),(h),(o),(v),(c))
2829c914b73Sdyoung #define	bus_space_set_multi_8(t, h, o, v, c)				\
2839c914b73Sdyoung 	__bs_set(sm,8,uint64_t,(t),(h),(o),(v),(c))
2849c914b73Sdyoung 
2859c914b73Sdyoung 
2869c914b73Sdyoung /*
2879c914b73Sdyoung  * Set region operations.
2889c914b73Sdyoung  */
2899c914b73Sdyoung #define	bus_space_set_region_1(t, h, o, v, c)				\
2909c914b73Sdyoung 	__bs_set(sr,1,uint8_t,(t),(h),(o),(v),(c))
2919c914b73Sdyoung #define	bus_space_set_region_2(t, h, o, v, c)				\
2929c914b73Sdyoung 	__bs_set(sr,2,uint16_t,(t),(h),(o),(v),(c))
2939c914b73Sdyoung #define	bus_space_set_region_4(t, h, o, v, c)				\
2949c914b73Sdyoung 	__bs_set(sr,4,uint32_t,(t),(h),(o),(v),(c))
2959c914b73Sdyoung #define	bus_space_set_region_8(t, h, o, v, c)				\
2969c914b73Sdyoung 	__bs_set(sr,8,uint64_t,(t),(h),(o),(v),(c))
2979c914b73Sdyoung 
2989c914b73Sdyoung 
2999c914b73Sdyoung /*
3009c914b73Sdyoung  * Copy region operations.
3019c914b73Sdyoung  */
3029c914b73Sdyoung #define	bus_space_copy_region_1(t, h1, o1, h2, o2, c)			\
3039c914b73Sdyoung 	__bs_copy(1, uint8_t, (t), (h1), (o1), (h2), (o2), (c))
3049c914b73Sdyoung #define	bus_space_copy_region_2(t, h1, o1, h2, o2, c)			\
3059c914b73Sdyoung 	__bs_copy(2, uint16_t, (t), (h1), (o1), (h2), (o2), (c))
3069c914b73Sdyoung #define	bus_space_copy_region_4(t, h1, o1, h2, o2, c)			\
3079c914b73Sdyoung 	__bs_copy(4, uint32_t, (t), (h1), (o1), (h2), (o2), (c))
3089c914b73Sdyoung #define	bus_space_copy_region_8(t, h1, o1, h2, o2, c)			\
3099c914b73Sdyoung 	__bs_copy(8, uint64_t, (t), (h1), (o1), (h2), (o2), (c))
3109c914b73Sdyoung 
3119c914b73Sdyoung #endif /* _KERNEL */
3129c914b73Sdyoung 
3139c914b73Sdyoung #endif /* _MIPS_BUS_SPACE_FUNCS_H_ */
314