Subject: MI bus ops(Re: 16bit aligned NS16550 variant)
To: , <mouse@rodents.montreal.qc.ca>
From: TAKEMURA Shin <takemura@netbsd.org>
List: tech-kern
Date: 11/04/2001 11:24:41
This is a multi-part message in MIME format.

------=_NextPart_000_0164_01C16523.4BBEF0F0
Content-Type: text/plain;
	charset="iso-2022-jp"
Content-Transfer-Encoding: 7bit

In the last discussion, I found that function vector definition of
bus_space method should be michine independent.

I've rewrote hpcmips bus.h and made new MI header, bus_ops.h
which contains function vector definitions. I recomend you to rewrite 
your port's bus.h with bus_ops.h, however, I don't force to rewrite all
ports' bus.h with bus_ops.h.

I'd like to put bus_ops.h into sys/dev. (I mean sys/dev/bus_ops.h)

How do you think?
If no one objecs, I will commit this header in a few days.

Takemura


------=_NextPart_000_0164_01C16523.4BBEF0F0
Content-Type: application/octet-stream;
	name="bus_ops.h"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="bus_ops.h"

/*	$NetBSD: $	*/=0A=
=0A=
/*-=0A=
 * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.=0A=
 * All rights reserved.=0A=
 *=0A=
 * This code is derived from software contributed to The NetBSD =
Foundation=0A=
 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,=0A=
 * NASA Ames Research Center.=0A=
 *=0A=
 * Redistribution and use in source and binary forms, with or without=0A=
 * modification, are permitted provided that the following conditions=0A=
 * are met:=0A=
 * 1. Redistributions of source code must retain the above copyright=0A=
 *    notice, this list of conditions and the following disclaimer.=0A=
 * 2. Redistributions in binary form must reproduce the above copyright=0A=
 *    notice, this list of conditions and the following disclaimer in the=0A=
 *    documentation and/or other materials provided with the =
distribution.=0A=
 * 3. All advertising materials mentioning features or use of this =
software=0A=
 *    must display the following acknowledgement:=0A=
 *	This product includes software developed by the NetBSD=0A=
 *	Foundation, Inc. and its contributors.=0A=
 * 4. Neither the name of The NetBSD Foundation nor the names of its=0A=
 *    contributors may be used to endorse or promote products derived=0A=
 *    from this software without specific prior written permission.=0A=
 *=0A=
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND =
CONTRIBUTORS=0A=
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT =
LIMITED=0A=
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A =
PARTICULAR=0A=
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR =
CONTRIBUTORS=0A=
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR=0A=
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF=0A=
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR =
BUSINESS=0A=
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER =
IN=0A=
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR =
OTHERWISE)=0A=
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED =
OF THE=0A=
 * POSSIBILITY OF SUCH DAMAGE.=0A=
 */=0A=
=0A=
/*=0A=
 * Copyright (c) 1996 Charles M. Hannum.  All rights reserved.=0A=
 * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.=0A=
 *=0A=
 * Redistribution and use in source and binary forms, with or without=0A=
 * modification, are permitted provided that the following conditions=0A=
 * are met:=0A=
 * 1. Redistributions of source code must retain the above copyright=0A=
 *    notice, this list of conditions and the following disclaimer.=0A=
 * 2. Redistributions in binary form must reproduce the above copyright=0A=
 *    notice, this list of conditions and the following disclaimer in the=0A=
 *    documentation and/or other materials provided with the =
distribution.=0A=
 * 3. All advertising materials mentioning features or use of this =
software=0A=
 *    must display the following acknowledgement:=0A=
 *      This product includes software developed by Christopher G. =
Demetriou=0A=
 *	for the NetBSD Project.=0A=
 * 4. The name of the author may not be used to endorse or promote =
products=0A=
 *    derived from this software without specific prior written =
permission=0A=
 *=0A=
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR=0A=
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED =
WARRANTIES=0A=
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE =
DISCLAIMED.=0A=
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,=0A=
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, =
BUT=0A=
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF =
USE,=0A=
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY=0A=
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT=0A=
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE =
OF=0A=
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.=0A=
 */=0A=
=0A=
#ifndef _BUS_OPS_H_=0A=
#define _BUS_OPS_H_=0A=
=0A=
/*=0A=
 * bus space operaion table=0A=
 */=0A=
struct bus_space_ops {=0A=
	/* mapping/unmapping */=0A=
	int	  (*bs_map)(bus_space_tag_t, bus_addr_t, bus_size_t,=0A=
		      int, bus_space_handle_t *);=0A=
	void	  (*bs_unmap)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
	int	  (*bs_subregion)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, bus_size_t, bus_space_handle_t *);=0A=
=0A=
	/* allocation/deallocation */=0A=
	int	  (*bs_alloc)(bus_space_tag_t, bus_addr_t,=0A=
		      bus_addr_t, bus_size_t, bus_size_t, bus_size_t,=0A=
		      int, bus_addr_t *, bus_space_handle_t *);=0A=
	void	  (*bs_free)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
=0A=
	/* get kernel virtual address */=0A=
	void *	  (*bs_vaddr)(bus_space_tag_t, bus_space_handle_t);=0A=
=0A=
	/* mmap bus space for user */=0A=
	paddr_t	  (*bs_mmap)(bus_space_tag_t, bus_addr_t, off_t, int, int);=0A=
=0A=
	/* barrier */=0A=
	void	  (*bs_barrier)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, bus_size_t, int);=0A=
=0A=
	/* read (single) */=0A=
	u_int8_t  (*bs_r_1)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
	u_int16_t (*bs_r_2)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
	u_int32_t (*bs_r_4)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
	u_int64_t (*bs_r_8)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
=0A=
	/* read multiple */=0A=
	void	  (*bs_rm_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int8_t *, bus_size_t);=0A=
	void	  (*bs_rm_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int16_t *, bus_size_t);=0A=
	void	  (*bs_rm_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int32_t *, bus_size_t);=0A=
	void	  (*bs_rm_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int64_t *, bus_size_t);=0A=
					=0A=
	/* read region */=0A=
	void	  (*bs_rr_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int8_t *, bus_size_t);=0A=
	void	  (*bs_rr_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int16_t *, bus_size_t);=0A=
	void	  (*bs_rr_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int32_t *, bus_size_t);=0A=
	void	  (*bs_rr_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int64_t *, bus_size_t);=0A=
					=0A=
	/* write (single) */=0A=
	void	  (*bs_w_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int8_t);=0A=
	void	  (*bs_w_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int16_t);=0A=
	void	  (*bs_w_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int32_t);=0A=
	void	  (*bs_w_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int64_t);=0A=
=0A=
	/* write multiple */=0A=
	void	  (*bs_wm_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int8_t *, bus_size_t);=0A=
	void	  (*bs_wm_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int16_t *, bus_size_t);=0A=
	void	  (*bs_wm_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int32_t *, bus_size_t);=0A=
	void	  (*bs_wm_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int64_t *, bus_size_t);=0A=
					=0A=
	/* write region */=0A=
	void	  (*bs_wr_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int8_t *, bus_size_t);=0A=
	void	  (*bs_wr_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int16_t *, bus_size_t);=0A=
	void	  (*bs_wr_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int32_t *, bus_size_t);=0A=
	void	  (*bs_wr_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int64_t *, bus_size_t);=0A=
=0A=
#ifdef __BUS_SPACE_HAS_STREAM_REAL_METHODS=0A=
	/* read (single) stream */=0A=
	u_int8_t  (*bs_rs_1)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
	u_int16_t (*bs_rs_2)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
	u_int32_t (*bs_rs_4)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
	u_int64_t (*bs_rs_8)(bus_space_tag_t, bus_space_handle_t, bus_size_t);=0A=
=0A=
	/* read multiple stream */=0A=
	void	  (*bs_rms_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int8_t *, bus_size_t);=0A=
	void	  (*bs_rms_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int16_t *, bus_size_t);=0A=
	void	  (*bs_rms_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int32_t *, bus_size_t);=0A=
	void	  (*bs_rms_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int64_t *, bus_size_t);=0A=
					=0A=
	/* read region stream */=0A=
	void	  (*bs_rrs_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int8_t *, bus_size_t);=0A=
	void	  (*bs_rrs_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int16_t *, bus_size_t);=0A=
	void	  (*bs_rrs_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int32_t *, bus_size_t);=0A=
	void	  (*bs_rrs_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int64_t *, bus_size_t);=0A=
					=0A=
	/* write (single) stream */=0A=
	void	  (*bs_ws_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int8_t);=0A=
	void	  (*bs_ws_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int16_t);=0A=
	void	  (*bs_ws_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int32_t);=0A=
	void	  (*bs_ws_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int64_t);=0A=
=0A=
	/* write multiple stream */=0A=
	void	  (*bs_wms_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int8_t *, bus_size_t);=0A=
	void	  (*bs_wms_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int16_t *, bus_size_t);=0A=
	void	  (*bs_wms_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int32_t *, bus_size_t);=0A=
	void	  (*bs_wms_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int64_t *, bus_size_t);=0A=
					=0A=
	/* write region stream */=0A=
	void	  (*bs_wrs_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int8_t *, bus_size_t);=0A=
	void	  (*bs_wrs_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int16_t *, bus_size_t);=0A=
	void	  (*bs_wrs_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int32_t *, bus_size_t);=0A=
	void	  (*bs_wrs_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, const u_int64_t *, bus_size_t);=0A=
#endif /* __BUS_SPACE_HAS_STREAM_REAL_METHODS */=0A=
=0A=
	/* set multiple */=0A=
	void	  (*bs_sm_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int8_t, bus_size_t);=0A=
	void	  (*bs_sm_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int16_t, bus_size_t);=0A=
	void	  (*bs_sm_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int32_t, bus_size_t);=0A=
	void	  (*bs_sm_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int64_t, bus_size_t);=0A=
=0A=
	/* set region */=0A=
	void	  (*bs_sr_1)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int8_t, bus_size_t);=0A=
	void	  (*bs_sr_2)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int16_t, bus_size_t);=0A=
	void	  (*bs_sr_4)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int32_t, bus_size_t);=0A=
	void	  (*bs_sr_8)(bus_space_tag_t, bus_space_handle_t,=0A=
		      bus_size_t, u_int64_t, bus_size_t);=0A=
=0A=
	/* copy */=0A=
	void	  (*bs_c_1)(bus_space_tag_t, bus_space_handle_t, bus_size_t,=0A=
		      bus_space_handle_t, bus_size_t, bus_size_t);=0A=
	void	  (*bs_c_2)(bus_space_tag_t, bus_space_handle_t, bus_size_t,=0A=
		      bus_space_handle_t, bus_size_t, bus_size_t);=0A=
	void	  (*bs_c_4)(bus_space_tag_t, bus_space_handle_t, bus_size_t,=0A=
		      bus_space_handle_t, bus_size_t, bus_size_t);=0A=
	void	  (*bs_c_8)(bus_space_tag_t, bus_space_handle_t, bus_size_t,=0A=
		      bus_space_handle_t, bus_size_t, bus_size_t);=0A=
};=0A=
=0A=
=0A=
/*=0A=
 * Utility macros; INTERNAL USE ONLY.=0A=
 */=0A=
#define	__bs_c(a,b)		__CONCAT(a,b)=0A=
#define	__bs_opname(op,s)	__bs_c(__bs_c(__bs_c(bs_,op),_),s)=0A=
#define	__bs_popname(pfx,op,s)	__bs_c(pfx,__bs_c(_,__bs_opname(op,s)))=0A=
=0A=
#define	__bs_rs(sz, t, h, o)						\=0A=
	(*(t)->bs_ops.__bs_opname(r,sz))(t, h, o)=0A=
#define	__bs_ws(sz, t, h, o, v)						\=0A=
	(*(t)->bs_ops.__bs_opname(w,sz))(t, h, o, v)=0A=
#ifdef __BUS_SPACE_HAS_STREAM_REAL_METHODS=0A=
#define	__bs_rss(sz, t, h, o)						\=0A=
	(*(t)->bs_ops.__bs_opname(rs,sz))(t, h, o)=0A=
#define	__bs_wss(sz, t, h, o, v)					\=0A=
	(*(t)->bs_ops.__bs_opname(ws,sz))(t, h, o, v)=0A=
#endif /* __BUS_SPACE_HAS_STREAM_REAL_METHODS */=0A=
#define	__bs_nonsingle(type, sz, t, h, o, a, c)				\=0A=
	(*(t)->bs_ops.__bs_opname(type,sz))(t, h, o, a, c)=0A=
#define	__bs_set(type, sz, t, h, o, v, c)				\=0A=
	(*(t)->bs_ops.__bs_opname(type,sz))(t, h, o, v, c)=0A=
#define	__bs_copy(sz, t, h1, o1, h2, o2, cnt)				\=0A=
	(*(t)->bs_ops.__bs_opname(c,sz))(t, h1, o1, h2, o2, cnt)=0A=
=0A=
=0A=
/*=0A=
 * Mapping and unmapping operations.=0A=
 */=0A=
#define	bus_space_map(t, a, s, c, hp)					\=0A=
	(*(t)->bs_ops.bs_map)(t, (a), (s), (c), (hp))=0A=
#define	bus_space_unmap(t, h, s)					\=0A=
	(*(t)->bs_ops.bs_unmap)(t, (h), (s))=0A=
#define	bus_space_subregion(t, h, o, s, hp)				\=0A=
	(*(t)->bs_ops.bs_subregion)(t, (h), (o), (s), (hp))=0A=
=0A=
=0A=
/*=0A=
 * Allocation and deallocation operations.=0A=
 */=0A=
#define	bus_space_alloc(t, rs, re, s, a, b, c, ap, hp)			\=0A=
	(*(t)->bs_ops.bs_alloc)(t, (rs), (re), (s), (a), (b), (c), (ap), (hp))=0A=
#define	bus_space_free(t, h, s)						\=0A=
	(*(t)->bs_ops.bs_free)(t, (h), (s))=0A=
=0A=
=0A=
/*=0A=
 * Get kernel virtual address for ranges mapped BUS_SPACE_MAP_LINEAR.=0A=
 */=0A=
#define	bus_space_vaddr(t, h)						\=0A=
	(*(t)->bs_ops.bs_vaddr)(t, (h))=0A=
=0A=
=0A=
/*=0A=
 * MMap bus space for a user application.=0A=
 */=0A=
#define bus_space_mmap(t, a, o, p, f)					\=0A=
	(*(t)->bs_ops.bs_mmap)(t, (a), (o), (p), (f))=0A=
=0A=
=0A=
/*=0A=
 * Bus barrier operations.=0A=
 */=0A=
#define	bus_space_barrier(t, h, o, l, f)				\=0A=
	(*(t)->bs_ops.bs_barrier)(t, (h), (o), (l), (f))=0A=
=0A=
=0A=
/*=0A=
 * Bus read (single) operations.=0A=
 */=0A=
#define	bus_space_read_1(t, h, o)	__bs_rs(1,(t),(h),(o))=0A=
#define	bus_space_read_2(t, h, o)	__bs_rs(2,(t),(h),(o))=0A=
#define	bus_space_read_4(t, h, o)	__bs_rs(4,(t),(h),(o))=0A=
#define	bus_space_read_8(t, h, o)	__bs_rs(8,(t),(h),(o))=0A=
=0A=
=0A=
/*=0A=
 * Bus read multiple operations.=0A=
 */=0A=
#define	bus_space_read_multi_1(t, h, o, a, c)				\=0A=
	__bs_nonsingle(rm,1,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_multi_2(t, h, o, a, c)				\=0A=
	__bs_nonsingle(rm,2,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_multi_4(t, h, o, a, c)				\=0A=
	__bs_nonsingle(rm,4,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_multi_8(t, h, o, a, c)				\=0A=
	__bs_nonsingle(rm,8,(t),(h),(o),(a),(c))=0A=
=0A=
=0A=
/*=0A=
 * Bus read region operations.=0A=
 */=0A=
#define	bus_space_read_region_1(t, h, o, a, c)				\=0A=
	__bs_nonsingle(rr,1,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_region_2(t, h, o, a, c)				\=0A=
	__bs_nonsingle(rr,2,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_region_4(t, h, o, a, c)				\=0A=
	__bs_nonsingle(rr,4,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_region_8(t, h, o, a, c)				\=0A=
	__bs_nonsingle(rr,8,(t),(h),(o),(a),(c))=0A=
=0A=
=0A=
/*=0A=
 * Bus write (single) operations.=0A=
 */=0A=
#define	bus_space_write_1(t, h, o, v)	__bs_ws(1,(t),(h),(o),(v))=0A=
#define	bus_space_write_2(t, h, o, v)	__bs_ws(2,(t),(h),(o),(v))=0A=
#define	bus_space_write_4(t, h, o, v)	__bs_ws(4,(t),(h),(o),(v))=0A=
#define	bus_space_write_8(t, h, o, v)	__bs_ws(8,(t),(h),(o),(v))=0A=
=0A=
=0A=
/*=0A=
 * Bus write multiple operations.=0A=
 */=0A=
#define	bus_space_write_multi_1(t, h, o, a, c)				\=0A=
	__bs_nonsingle(wm,1,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_multi_2(t, h, o, a, c)				\=0A=
	__bs_nonsingle(wm,2,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_multi_4(t, h, o, a, c)				\=0A=
	__bs_nonsingle(wm,4,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_multi_8(t, h, o, a, c)				\=0A=
	__bs_nonsingle(wm,8,(t),(h),(o),(a),(c))=0A=
=0A=
=0A=
/*=0A=
 * Bus write region operations.=0A=
 */=0A=
#define	bus_space_write_region_1(t, h, o, a, c)				\=0A=
	__bs_nonsingle(wr,1,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_region_2(t, h, o, a, c)				\=0A=
	__bs_nonsingle(wr,2,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_region_4(t, h, o, a, c)				\=0A=
	__bs_nonsingle(wr,4,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_region_8(t, h, o, a, c)				\=0A=
	__bs_nonsingle(wr,8,(t),(h),(o),(a),(c))=0A=
=0A=
=0A=
#ifdef __BUS_SPACE_HAS_STREAM_REAL_METHODS=0A=
/*=0A=
 * Bus read (single) stream operations.=0A=
 */=0A=
#define	bus_space_read_stream_1(t, h, o)	__bs_rss(1,(t),(h),(o))=0A=
#define	bus_space_read_stream_2(t, h, o)	__bs_rss(2,(t),(h),(o))=0A=
#define	bus_space_read_stream_4(t, h, o)	__bs_rss(4,(t),(h),(o))=0A=
#define	bus_space_read_stream_8(t, h, o)	__bs_rss(8,(t),(h),(o))=0A=
=0A=
=0A=
/*=0A=
 * Bus read multiple operations.=0A=
 */=0A=
#define	bus_space_read_multi_stream_1(t, h, o, a, c)			\=0A=
	__bs_nonsingle(rms,1,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_multi_stream_2(t, h, o, a, c)			\=0A=
	__bs_nonsingle(rms,2,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_multi_stream_4(t, h, o, a, c)			\=0A=
	__bs_nonsingle(rms,4,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_multi_stream_8(t, h, o, a, c)			\=0A=
	__bs_nonsingle(rms,8,(t),(h),(o),(a),(c))=0A=
=0A=
=0A=
/*=0A=
 * Bus read region operations.=0A=
 */=0A=
#define	bus_space_read_region_stream_1(t, h, o, a, c)			\=0A=
	__bs_nonsingle(rrs,1,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_region_stream_2(t, h, o, a, c)			\=0A=
	__bs_nonsingle(rrs,2,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_region_stream_4(t, h, o, a, c)			\=0A=
	__bs_nonsingle(rrs,4,(t),(h),(o),(a),(c))=0A=
#define	bus_space_read_region_stream_8(t, h, o, a, c)			\=0A=
	__bs_nonsingle(rrs,8,(t),(h),(o),(a),(c))=0A=
=0A=
=0A=
/*=0A=
 * Bus write (single) operations.=0A=
 */=0A=
#define	bus_space_write_stream_1(t, h, o, v)	__bs_wss(1,(t),(h),(o),(v))=0A=
#define	bus_space_write_stream_2(t, h, o, v)	__bs_wss(2,(t),(h),(o),(v))=0A=
#define	bus_space_write_stream_4(t, h, o, v)	__bs_wss(4,(t),(h),(o),(v))=0A=
#define	bus_space_write_stream_8(t, h, o, v)	__bs_wss(8,(t),(h),(o),(v))=0A=
=0A=
=0A=
/*=0A=
 * Bus write multiple operations.=0A=
 */=0A=
#define	bus_space_write_multi_stream_1(t, h, o, a, c)			\=0A=
	__bs_nonsingle(wms,1,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_multi_stream_2(t, h, o, a, c)			\=0A=
	__bs_nonsingle(wms,2,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_multi_stream_4(t, h, o, a, c)			\=0A=
	__bs_nonsingle(wms,4,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_multi_stream_8(t, h, o, a, c)			\=0A=
	__bs_nonsingle(wms,8,(t),(h),(o),(a),(c))=0A=
=0A=
=0A=
/*=0A=
 * Bus write region operations.=0A=
 */=0A=
#define	bus_space_write_region_stream_1(t, h, o, a, c)			\=0A=
	__bs_nonsingle(wrs,1,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_region_stream_2(t, h, o, a, c)			\=0A=
	__bs_nonsingle(wrs,2,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_region_stream_4(t, h, o, a, c)			\=0A=
	__bs_nonsingle(wrs,4,(t),(h),(o),(a),(c))=0A=
#define	bus_space_write_region_stream_8(t, h, o, a, c)			\=0A=
	__bs_nonsingle(wrs,8,(t),(h),(o),(a),(c))=0A=
#else=0A=
#ifdef __BUS_SPACE_HAS_STREAM_METHODS=0A=
#define bus_space_read_stream_1 bus_space_read_1=0A=
#define bus_space_read_stream_2 bus_space_read_2=0A=
#define bus_space_read_stream_4 bus_space_read_4=0A=
#define	bus_space_read_stream_8 bus_space_read_8=0A=
#define bus_space_read_multi_stream_1 bus_space_read_multi_1=0A=
#define bus_space_read_multi_stream_2 bus_space_read_multi_2=0A=
#define bus_space_read_multi_stream_4 bus_space_read_multi_4=0A=
#define	bus_space_read_multi_stream_8 bus_space_read_multi_8=0A=
#define bus_space_read_region_stream_1 bus_space_read_region_1=0A=
#define bus_space_read_region_stream_2 bus_space_read_region_2=0A=
#define bus_space_read_region_stream_4 bus_space_read_region_4=0A=
#define	bus_space_read_region_stream_8 bus_space_read_region_8=0A=
#define bus_space_write_stream_1 bus_space_write_1=0A=
#define bus_space_write_stream_2 bus_space_write_2=0A=
#define bus_space_write_stream_4 bus_space_write_4=0A=
#define	bus_space_write_stream_8 bus_space_write_8=0A=
#define bus_space_write_multi_stream_1 bus_space_write_multi_1=0A=
#define bus_space_write_multi_stream_2 bus_space_write_multi_2=0A=
#define bus_space_write_multi_stream_4 bus_space_write_multi_4=0A=
#define	bus_space_write_multi_stream_8 bus_space_write_multi_8=0A=
#define bus_space_write_region_stream_1 bus_space_write_region_1=0A=
#define bus_space_write_region_stream_2 bus_space_write_region_2=0A=
#define bus_space_write_region_stream_4 bus_space_write_region_4=0A=
#define	bus_space_write_region_stream_8	bus_space_write_region_8=0A=
#endif=0A=
#endif /* __BUS_SPACE_HAS_STREAM_REAL_METHODS */=0A=
=0A=
=0A=
/*=0A=
 * Set multiple operations.=0A=
 */=0A=
#define	bus_space_set_multi_1(t, h, o, v, c)				\=0A=
	__bs_set(sm,1,(t),(h),(o),(v),(c))=0A=
#define	bus_space_set_multi_2(t, h, o, v, c)				\=0A=
	__bs_set(sm,2,(t),(h),(o),(v),(c))=0A=
#define	bus_space_set_multi_4(t, h, o, v, c)				\=0A=
	__bs_set(sm,4,(t),(h),(o),(v),(c))=0A=
#define	bus_space_set_multi_8(t, h, o, v, c)				\=0A=
	__bs_set(sm,8,(t),(h),(o),(v),(c))=0A=
=0A=
=0A=
/*=0A=
 * Set region operations.=0A=
 */=0A=
#define	bus_space_set_region_1(t, h, o, v, c)				\=0A=
	__bs_set(sr,1,(t),(h),(o),(v),(c))=0A=
#define	bus_space_set_region_2(t, h, o, v, c)				\=0A=
	__bs_set(sr,2,(t),(h),(o),(v),(c))=0A=
#define	bus_space_set_region_4(t, h, o, v, c)				\=0A=
	__bs_set(sr,4,(t),(h),(o),(v),(c))=0A=
#define	bus_space_set_region_8(t, h, o, v, c)				\=0A=
	__bs_set(sr,8,(t),(h),(o),(v),(c))=0A=
=0A=
=0A=
/*=0A=
 * Copy operations.=0A=
 */=0A=
#define	bus_space_copy_region_1(t, h1, o1, h2, o2, c)			\=0A=
	__bs_copy(1, t, h1, o1, h2, o2, c)=0A=
#define	bus_space_copy_region_2(t, h1, o1, h2, o2, c)			\=0A=
	__bs_copy(2, t, h1, o1, h2, o2, c)=0A=
#define	bus_space_copy_region_4(t, h1, o1, h2, o2, c)			\=0A=
	__bs_copy(4, t, h1, o1, h2, o2, c)=0A=
#define	bus_space_copy_region_8(t, h1, o1, h2, o2, c)			\=0A=
	__bs_copy(8, t, h1, o1, h2, o2, c)=0A=
=0A=
=0A=
/*=0A=
 * Macros to provide prototypes for all the functions used in the=0A=
 * bus_space structure=0A=
 */=0A=
#define bs_map_proto(f)							\=0A=
int	__bs_c(f,_bs_map)(bus_space_tag_t t, bus_addr_t addr,		\=0A=
	    bus_size_t size, int cacheable, bus_space_handle_t *bshp)=0A=
=0A=
#define bs_unmap_proto(f)						\=0A=
void	__bs_c(f,_bs_unmap)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t size)=0A=
=0A=
#define bs_subregion_proto(f)						\=0A=
int	__bs_c(f,_bs_subregion)(bus_space_tag_t t,			\=0A=
	    bus_space_handle_t bsh, bus_size_t offset,			\=0A=
	    bus_size_t size, bus_space_handle_t *nbshp)=0A=
=0A=
#define bs_alloc_proto(f)						\=0A=
int	__bs_c(f,_bs_alloc)(bus_space_tag_t t, bus_addr_t rstart,	\=0A=
	    bus_addr_t rend, bus_size_t size, bus_size_t align,		\=0A=
	    bus_size_t boundary, int cacheable, bus_addr_t *addrp,	\=0A=
	    bus_space_handle_t *bshp)=0A=
=0A=
#define bs_free_proto(f)						\=0A=
void	__bs_c(f,_bs_free)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t size)=0A=
=0A=
#define bs_vaddr_proto(f)						\=0A=
void *	__bs_c(f,_bs_vaddr)(bus_space_tag_t t, bus_space_handle_t bsh)=0A=
=0A=
#define bs_mmap_proto(f)						\=0A=
paddr_t	__bs_c(f,_bs_mmap)(bus_space_tag_t t, bus_addr_t addr,		\=0A=
	    off_t offset, int prot, int flags)=0A=
=0A=
#define bs_barrier_proto(f)						\=0A=
void	__bs_c(f,_bs_barrier)(bus_space_tag_t t, bus_space_handle_t bsh,\=0A=
	    bus_size_t offset, bus_size_t len, int flags)=0A=
=0A=
#define	bs_r_1_proto(f)							\=0A=
u_int8_t	__bs_c(f,_bs_r_1)(bus_space_tag_t t,			\=0A=
		    bus_space_handle_t bsh, bus_size_t offset)=0A=
#define	bs_r_2_proto(f)							\=0A=
u_int16_t	__bs_c(f,_bs_r_2)(bus_space_tag_t t,			\=0A=
		    bus_space_handle_t bsh, bus_size_t offset)=0A=
#define	bs_r_4_proto(f)							\=0A=
u_int32_t	__bs_c(f,_bs_r_4)(bus_space_tag_t t,			\=0A=
		    bus_space_handle_t bsh, bus_size_t offset)=0A=
#define	bs_r_8_proto(f)							\=0A=
u_int64_t	__bs_c(f,_bs_r_8)(bus_space_tag_t t,			\=0A=
		    bus_space_handle_t bsh, bus_size_t offset)=0A=
=0A=
#define	bs_rm_1_proto(f)						\=0A=
void	__bs_c(f,_bs_rm_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int8_t *addr,	bus_size_t count)=0A=
#define	bs_rm_2_proto(f)						\=0A=
void	__bs_c(f,_bs_rm_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int16_t *addr,	bus_size_t count)=0A=
#define	bs_rm_4_proto(f)						\=0A=
void	__bs_c(f,_bs_rm_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int32_t *addr,	bus_size_t count)=0A=
#define	bs_rm_8_proto(f)						\=0A=
void	__bs_c(f,_bs_rm_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int64_t *addr,	bus_size_t count)=0A=
=0A=
#define	bs_rr_1_proto(f)						\=0A=
void	__bs_c(f,_bs_rr_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, u_int8_t *addr, bus_size_t count)=0A=
#define	bs_rr_2_proto(f)						\=0A=
void	__bs_c(f,_bs_rr_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, u_int16_t *addr, bus_size_t count)=0A=
#define	bs_rr_4_proto(f)						\=0A=
void	__bs_c(f,_bs_rr_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, u_int32_t *addr, bus_size_t count)=0A=
#define	bs_rr_8_proto(f)						\=0A=
void	__bs_c(f,_bs_rr_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, u_int64_t *addr, bus_size_t count)=0A=
=0A=
#define	bs_w_1_proto(f)							\=0A=
void	__bs_c(f,_bs_w_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int8_t value)=0A=
#define	bs_w_2_proto(f)							\=0A=
void	__bs_c(f,_bs_w_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int16_t value)=0A=
#define	bs_w_4_proto(f)							\=0A=
void	__bs_c(f,_bs_w_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int32_t value)=0A=
#define	bs_w_8_proto(f)							\=0A=
void	__bs_c(f,_bs_w_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int64_t value)=0A=
=0A=
#define	bs_wm_1_proto(f)						\=0A=
void	__bs_c(f,_bs_wm_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, const u_int8_t *addr, bus_size_t count)=0A=
#define	bs_wm_2_proto(f)						\=0A=
void	__bs_c(f,_bs_wm_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, const u_int16_t *addr, bus_size_t count)=0A=
#define	bs_wm_4_proto(f)						\=0A=
void	__bs_c(f,_bs_wm_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, const u_int32_t *addr, bus_size_t count)=0A=
#define	bs_wm_8_proto(f)						\=0A=
void	__bs_c(f,_bs_wm_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, const u_int64_t *addr, bus_size_t count)=0A=
=0A=
#define	bs_wr_1_proto(f)						\=0A=
void	__bs_c(f,_bs_wr_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, const u_int8_t *addr, bus_size_t count)=0A=
#define	bs_wr_2_proto(f)						\=0A=
void	__bs_c(f,_bs_wr_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, const u_int16_t *addr, bus_size_t count)=0A=
#define	bs_wr_4_proto(f)						\=0A=
void	__bs_c(f,_bs_wr_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, const u_int32_t *addr, bus_size_t count)=0A=
#define	bs_wr_8_proto(f)						\=0A=
void	__bs_c(f,_bs_wr_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, const u_int64_t *addr, bus_size_t count)=0A=
=0A=
#ifdef __BUS_SPACE_HAS_STREAM_REAL_METHODS=0A=
#define	bs_rs_1_proto(f)						\=0A=
u_int8_t	__bs_c(f,_bs_rs_1)(bus_space_tag_t t,			\=0A=
		    bus_space_handle_t bsh, bus_size_t offset)=0A=
#define	bs_rs_2_proto(f)						\=0A=
u_int16_t	__bs_c(f,_bs_rs_2)(bus_space_tag_t t,			\=0A=
		    bus_space_handle_t bsh, bus_size_t offset)=0A=
#define	bs_rs_4_proto(f)						\=0A=
u_int32_t	__bs_c(f,_bs_rs_4)(bus_space_tag_t t,			\=0A=
		    bus_space_handle_t bsh, bus_size_t offset)=0A=
#define	bs_rs_8_proto(f)						\=0A=
u_int64_t	__bs_c(f,_bs_rs_8)(bus_space_tag_t t,			\=0A=
		    bus_space_handle_t bsh, bus_size_t offset)=0A=
=0A=
#define	bs_rms_1_proto(f)						\=0A=
void	__bs_c(f,_bs_rms_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int8_t *addr,	bus_size_t count)=0A=
#define	bs_rms_2_proto(f)						\=0A=
void	__bs_c(f,_bs_rms_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int16_t *addr,	bus_size_t count)=0A=
#define	bs_rms_4_proto(f)						\=0A=
void	__bs_c(f,_bs_rms_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int32_t *addr,	bus_size_t count)=0A=
#define	bs_rms_8_proto(f)						\=0A=
void	__bs_c(f,_bs_rms_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int64_t *addr,	bus_size_t count)=0A=
=0A=
#define	bs_rrs_1_proto(f)						\=0A=
void	__bs_c(f,_bs_rrs_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, u_int8_t *addr, bus_size_t count)=0A=
#define	bs_rrs_2_proto(f)						\=0A=
void	__bs_c(f,_bs_rrs_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, u_int16_t *addr, bus_size_t count)=0A=
#define	bs_rrs_4_proto(f)						\=0A=
void	__bs_c(f,_bs_rrs_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, u_int32_t *addr, bus_size_t count)=0A=
#define	bs_rrs_8_proto(f)						\=0A=
void	__bs_c(f,_bs_rrs_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, u_int64_t *addr, bus_size_t count)=0A=
=0A=
#define	bs_ws_1_proto(f)						\=0A=
void	__bs_c(f,_bs_ws_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int8_t value)=0A=
#define	bs_ws_2_proto(f)						\=0A=
void	__bs_c(f,_bs_ws_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int16_t value)=0A=
#define	bs_ws_4_proto(f)						\=0A=
void	__bs_c(f,_bs_ws_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int32_t value)=0A=
#define	bs_ws_8_proto(f)						\=0A=
void	__bs_c(f,_bs_ws_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int64_t value)=0A=
=0A=
#define	bs_wms_1_proto(f)						\=0A=
void	__bs_c(f,_bs_wms_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, const u_int8_t *addr, bus_size_t count)=0A=
#define	bs_wms_2_proto(f)						\=0A=
void	__bs_c(f,_bs_wms_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, const u_int16_t *addr, bus_size_t count)=0A=
#define	bs_wms_4_proto(f)						\=0A=
void	__bs_c(f,_bs_wms_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, const u_int32_t *addr, bus_size_t count)=0A=
#define	bs_wms_8_proto(f)						\=0A=
void	__bs_c(f,_bs_wms_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	   bus_size_t offset, const u_int64_t *addr, bus_size_t count)=0A=
=0A=
#define	bs_wrs_1_proto(f)						\=0A=
void	__bs_c(f,_bs_wrs_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, const u_int8_t *addr, bus_size_t count)=0A=
#define	bs_wrs_2_proto(f)						\=0A=
void	__bs_c(f,_bs_wrs_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, const u_int16_t *addr, bus_size_t count)=0A=
#define	bs_wrs_4_proto(f)						\=0A=
void	__bs_c(f,_bs_wrs_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, const u_int32_t *addr, bus_size_t count)=0A=
#define	bs_wrs_8_proto(f)						\=0A=
void	__bs_c(f,_bs_wrs_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, const u_int64_t *addr, bus_size_t count)=0A=
#else=0A=
#define	bs_rs_1_proto(f)=0A=
#define	bs_rs_2_proto(f)=0A=
#define	bs_rs_4_proto(f)=0A=
#define	bs_rs_8_proto(f)=0A=
#define	bs_rms_1_proto(f)=0A=
#define	bs_rms_2_proto(f)=0A=
#define	bs_rms_4_proto(f)=0A=
#define	bs_rms_8_proto(f)=0A=
#define	bs_rrs_1_proto(f)=0A=
#define	bs_rrs_2_proto(f)=0A=
#define	bs_rrs_4_proto(f)=0A=
#define	bs_rrs_8_proto(f)=0A=
#define	bs_ws_1_proto(f)=0A=
#define	bs_ws_2_proto(f)=0A=
#define	bs_ws_4_proto(f)=0A=
#define	bs_ws_8_proto(f)=0A=
#define	bs_wms_1_proto(f)=0A=
#define	bs_wms_2_proto(f)=0A=
#define	bs_wms_4_proto(f)=0A=
#define	bs_wms_8_proto(f)=0A=
#define	bs_wrs_1_proto(f)=0A=
#define	bs_wrs_2_proto(f)=0A=
#define	bs_wrs_4_proto(f)=0A=
#define	bs_wrs_8_proto(f)=0A=
#endif /* __BUS_SPACE_HAS_STREAM_REAL_METHODS */=0A=
=0A=
#define	bs_sm_1_proto(f)						\=0A=
void	__bs_c(f,_bs_sm_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int8_t value, bus_size_t count)=0A=
#define	bs_sm_2_proto(f)						\=0A=
void	__bs_c(f,_bs_sm_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int16_t value, bus_size_t count)=0A=
#define	bs_sm_4_proto(f)						\=0A=
void	__bs_c(f,_bs_sm_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int32_t value, bus_size_t count)=0A=
#define	bs_sm_8_proto(f)						\=0A=
void	__bs_c(f,_bs_sm_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int64_t value, bus_size_t count)=0A=
=0A=
#define	bs_sr_1_proto(f)						\=0A=
void	__bs_c(f,_bs_sr_1)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int8_t value, bus_size_t count)=0A=
#define	bs_sr_2_proto(f)						\=0A=
void	__bs_c(f,_bs_sr_2)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int16_t value, bus_size_t count)=0A=
#define	bs_sr_4_proto(f)						\=0A=
void	__bs_c(f,_bs_sr_4)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int32_t value, bus_size_t count)=0A=
#define	bs_sr_8_proto(f)						\=0A=
void	__bs_c(f,_bs_sr_8)(bus_space_tag_t t, bus_space_handle_t bsh,	\=0A=
	    bus_size_t offset, u_int64_t value, bus_size_t count)=0A=
=0A=
#define	bs_c_1_proto(f)							\=0A=
void	__bs_c(f,_bs_c_1)(bus_space_tag_t t, bus_space_handle_t bsh1,	\=0A=
	    bus_size_t offset1, bus_space_handle_t bsh2,		\=0A=
	    bus_size_t offset2, bus_size_t count)=0A=
#define	bs_c_2_proto(f)							\=0A=
void	__bs_c(f,_bs_c_2)(bus_space_tag_t t, bus_space_handle_t bsh1,	\=0A=
	    bus_size_t offset1, bus_space_handle_t bsh2,		\=0A=
	    bus_size_t offset2, bus_size_t count)=0A=
#define	bs_c_4_proto(f)							\=0A=
void	__bs_c(f,_bs_c_4)(bus_space_tag_t t, bus_space_handle_t bsh1,	\=0A=
	    bus_size_t offset1, bus_space_handle_t bsh2,		\=0A=
	    bus_size_t offset2, bus_size_t count)=0A=
#define	bs_c_8_proto(f)							\=0A=
void	__bs_c(f,_bs_c_8)(bus_space_tag_t t, bus_space_handle_t bsh1,	\=0A=
	    bus_size_t offset1, bus_space_handle_t bsh2,		\=0A=
	    bus_size_t offset2, bus_size_t count)=0A=
=0A=
=0A=
#define bus_space_protos(f)	\=0A=
bs_map_proto(f);		\=0A=
bs_unmap_proto(f);		\=0A=
bs_subregion_proto(f);		\=0A=
bs_alloc_proto(f);		\=0A=
bs_free_proto(f);		\=0A=
bs_vaddr_proto(f);		\=0A=
bs_mmap_proto(f);		\=0A=
bs_barrier_proto(f);		\=0A=
bs_r_1_proto(f);		\=0A=
bs_r_2_proto(f);		\=0A=
bs_r_4_proto(f);		\=0A=
bs_r_8_proto(f);		\=0A=
bs_rm_1_proto(f);		\=0A=
bs_rm_2_proto(f);		\=0A=
bs_rm_4_proto(f);		\=0A=
bs_rm_8_proto(f);		\=0A=
bs_rr_1_proto(f);		\=0A=
bs_rr_2_proto(f);		\=0A=
bs_rr_4_proto(f);		\=0A=
bs_rr_8_proto(f);		\=0A=
bs_w_1_proto(f);		\=0A=
bs_w_2_proto(f);		\=0A=
bs_w_4_proto(f);		\=0A=
bs_w_8_proto(f);		\=0A=
bs_wm_1_proto(f);		\=0A=
bs_wm_2_proto(f);		\=0A=
bs_wm_4_proto(f);		\=0A=
bs_wm_8_proto(f);		\=0A=
bs_wr_1_proto(f);		\=0A=
bs_wr_2_proto(f);		\=0A=
bs_wr_4_proto(f);		\=0A=
bs_wr_8_proto(f);		\=0A=
bs_rs_1_proto(f);		\=0A=
bs_rs_2_proto(f);		\=0A=
bs_rs_4_proto(f);		\=0A=
bs_rs_8_proto(f);		\=0A=
bs_rms_1_proto(f);		\=0A=
bs_rms_2_proto(f);		\=0A=
bs_rms_4_proto(f);		\=0A=
bs_rms_8_proto(f);		\=0A=
bs_rrs_1_proto(f);		\=0A=
bs_rrs_2_proto(f);		\=0A=
bs_rrs_4_proto(f);		\=0A=
bs_rrs_8_proto(f);		\=0A=
bs_ws_1_proto(f);		\=0A=
bs_ws_2_proto(f);		\=0A=
bs_ws_4_proto(f);		\=0A=
bs_ws_8_proto(f);		\=0A=
bs_wms_1_proto(f);		\=0A=
bs_wms_2_proto(f);		\=0A=
bs_wms_4_proto(f);		\=0A=
bs_wms_8_proto(f);		\=0A=
bs_wrs_1_proto(f);		\=0A=
bs_wrs_2_proto(f);		\=0A=
bs_wrs_4_proto(f);		\=0A=
bs_wrs_8_proto(f);		\=0A=
bs_sm_1_proto(f);		\=0A=
bs_sm_2_proto(f);		\=0A=
bs_sm_4_proto(f);		\=0A=
bs_sm_8_proto(f);		\=0A=
bs_sr_1_proto(f);		\=0A=
bs_sr_2_proto(f);		\=0A=
bs_sr_4_proto(f);		\=0A=
bs_sr_8_proto(f);		\=0A=
bs_c_1_proto(f);		\=0A=
bs_c_2_proto(f);		\=0A=
bs_c_4_proto(f);		\=0A=
bs_c_8_proto(f);=0A=
=0A=
=0A=
/*=0A=
 * bus DMA operaion table=0A=
 */=0A=
struct bus_dma_ops {=0A=
	/*=0A=
	 * DMA mapping methods.=0A=
	 */=0A=
	int	(*bd_map_create)(bus_dma_tag_t, bus_size_t, int,=0A=
		    bus_size_t, bus_size_t, int, bus_dmamap_t *);=0A=
	void	(*bd_map_destroy)(bus_dma_tag_t, bus_dmamap_t);=0A=
	int	(*bd_map_load)(bus_dma_tag_t, bus_dmamap_t, void *,=0A=
		    bus_size_t, struct proc *, int);=0A=
	int	(*bd_map_load_mbuf)(bus_dma_tag_t, bus_dmamap_t,=0A=
		    struct mbuf *, int);=0A=
	int	(*bd_map_load_uio)(bus_dma_tag_t, bus_dmamap_t,=0A=
		    struct uio *, int);=0A=
	int	(*bd_map_load_raw)(bus_dma_tag_t, bus_dmamap_t,=0A=
		    bus_dma_segment_t *, int, bus_size_t, int);=0A=
	void	(*bd_map_unload)(bus_dma_tag_t, bus_dmamap_t);=0A=
	void	(*bd_map_sync)(bus_dma_tag_t, bus_dmamap_t,=0A=
		    bus_addr_t, bus_size_t, int);=0A=
=0A=
	/*=0A=
	 * DMA memory utility functions.=0A=
	 */=0A=
	int	(*bd_mem_alloc)(bus_dma_tag_t, bus_size_t, bus_size_t,=0A=
		    bus_size_t, bus_dma_segment_t *, int, int *, int);=0A=
	void	(*bd_mem_free)(bus_dma_tag_t,=0A=
		    bus_dma_segment_t *, int);=0A=
	int	(*bd_mem_map)(bus_dma_tag_t, bus_dma_segment_t *,=0A=
		    int, size_t, caddr_t *, int);=0A=
	void	(*bd_mem_unmap)(bus_dma_tag_t, caddr_t, size_t);=0A=
	paddr_t	(*bd_mem_mmap)(bus_dma_tag_t, bus_dma_segment_t *,=0A=
		    int, off_t, int, int);=0A=
};=0A=
=0A=
=0A=
/*=0A=
 * bus DMA methods=0A=
 */=0A=
#define	bus_dmamap_create(t, s, n, m, b, f, p)				\=0A=
	(*(t)->bd_ops.bd_map_create)((t), (s), (n), (m), (b), (f), (p))=0A=
#define	bus_dmamap_destroy(t, p)					\=0A=
	(*(t)->bd_ops.bd_map_destroy)((t), (p))=0A=
#define	bus_dmamap_load(t, m, b, s, p, f)				\=0A=
	(*(t)->bd_ops.bd_map_load)((t), (m), (b), (s), (p), (f))=0A=
#define	bus_dmamap_load_mbuf(t, m, b, f)				\=0A=
	(*(t)->bd_ops.bd_map_load_mbuf)((t), (m), (b), (f))=0A=
#define	bus_dmamap_load_uio(t, m, u, f)					\=0A=
	(*(t)->bd_ops.bd_map_load_uio)((t), (m), (u), (f))=0A=
#define	bus_dmamap_load_raw(t, m, sg, n, s, f)				\=0A=
	(*(t)->bd_ops.bd_map_load_raw)((t), (m), (sg), (n), (s), (f))=0A=
#define	bus_dmamap_unload(t, p)						\=0A=
	(*(t)->bd_ops.bd_map_unload)((t), (p))=0A=
#define	bus_dmamap_sync(t, p, o, l, ops)				\=0A=
	(void)((t)->bd_ops.bd_map_sync ?				\=0A=
	    (*(t)->bd_ops.bd_map_sync)((t), (p), (o), (l), (ops)) : (void)0)=0A=
=0A=
#define	bus_dmamem_alloc(t, s, a, b, sg, n, r, f)			\=0A=
	(*(t)->bd_ops.bd_mem_alloc)((t), (s), (a), (b), (sg), (n), (r), (f))=0A=
#define	bus_dmamem_free(t, sg, n)					\=0A=
	(*(t)->bd_ops.bd_mem_free)((t), (sg), (n))=0A=
#define	bus_dmamem_map(t, sg, n, s, k, f)				\=0A=
	(*(t)->bd_ops.bd_mem_map)((t), (sg), (n), (s), (k), (f))=0A=
#define	bus_dmamem_unmap(t, k, s)					\=0A=
	(*(t)->bd_ops.bd_mem_unmap)((t), (k), (s))=0A=
#define	bus_dmamem_mmap(t, sg, n, o, p, f)				\=0A=
	(*(t)->bd_ops.bd_mem_mmap)((t), (sg), (n), (o), (p), (f))=0A=
=0A=
=0A=
/*=0A=
 * Macros to provide prototypes for all the functions used in the=0A=
 * bus_dma structure=0A=
 */=0A=
#define bus_dma_protos(f)						\=0A=
int	__bs_c(f,_bd_map_create)(bus_dma_tag_t, bus_size_t, int,	\=0A=
	    bus_size_t, bus_size_t, int, bus_dmamap_t *);		\=0A=
void	__bs_c(f,_bd_map_destroy)(bus_dma_tag_t, bus_dmamap_t);		\=0A=
int	__bs_c(f,_bd_map_load)(bus_dma_tag_t, bus_dmamap_t, void *,	\=0A=
	    bus_size_t, struct proc *, int);				\=0A=
int	__bs_c(f,_bd_map_load_mbuf)(bus_dma_tag_t, bus_dmamap_t,	\=0A=
	    struct mbuf *, int);					\=0A=
int	__bs_c(f,_bd_map_load_uio)(bus_dma_tag_t, bus_dmamap_t,		\=0A=
	    struct uio *, int);						\=0A=
int	__bs_c(f,_bd_map_load_raw)(bus_dma_tag_t, bus_dmamap_t,		\=0A=
	    bus_dma_segment_t *, int, bus_size_t, int);			\=0A=
void	__bs_c(f,_bd_map_unload)(bus_dma_tag_t, bus_dmamap_t);		\=0A=
void	__bs_c(f,_bd_map_sync)(bus_dma_tag_t, bus_dmamap_t,		\=0A=
	    bus_addr_t, bus_size_t, int);				\=0A=
int	__bs_c(f,_bd_mem_alloc)(bus_dma_tag_t, bus_size_t, bus_size_t,	\=0A=
	    bus_size_t, bus_dma_segment_t *, int, int *, int);		\=0A=
void	__bs_c(f,_bd_mem_free)(bus_dma_tag_t, bus_dma_segment_t *, int);\=0A=
int	__bs_c(f,_bd_mem_map)(bus_dma_tag_t, bus_dma_segment_t *,	\=0A=
	    int, size_t, caddr_t *, int);				\=0A=
void	__bs_c(f,_bd_mem_unmap)(bus_dma_tag_t, caddr_t, size_t);	\=0A=
paddr_t	__bs_c(f,_bd_mem_mmap)(bus_dma_tag_t, bus_dma_segment_t *,	\=0A=
	    int, off_t, int, int);=0A=
=0A=
#endif /* _BUS_OPS_H_ */=0A=

------=_NextPart_000_0164_01C16523.4BBEF0F0--