_bus.h revision 145253
1145253Simp/*-
2145253Simp * Copyright (c) 2005 M. Warner Losh.
3145253Simp * All rights reserved.
4145253Simp *
5145253Simp * Redistribution and use in source and binary forms, with or without
6145253Simp * modification, are permitted provided that the following conditions
7145253Simp * are met:
8145253Simp * 1. Redistributions of source code must retain the above copyright
9145253Simp *    notice, this list of conditions, and the following disclaimer,
10145253Simp *    without modification, immediately at the beginning of the file.
11145253Simp * 2. Redistributions in binary form must reproduce the above copyright
12145253Simp *    notice, this list of conditions and the following disclaimer in
13145253Simp *    the documentation and/or other materials provided with the
14145253Simp *    distribution.
15145253Simp *
16145253Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17145253Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18145253Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19145253Simp * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20145253Simp * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21145253Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22145253Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23145253Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24145253Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25145253Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26145253Simp * SUCH DAMAGE.
27145253Simp *
28145253Simp * $FreeBSD: head/sys/pc98/include/_bus.h 145253 2005-04-18 21:45:34Z imp $
29145253Simp */
30145253Simp
31145253Simp#ifndef PC98_INCLUDE__BUS_H
32145253Simp#define PC98_INCLUDE__BUS_H
33145253Simp
34145253Simp/*
35145253Simp * Bus address and size types
36145253Simp */
37145253Simptypedef u_int bus_addr_t;
38145253Simptypedef u_int bus_size_t;
39145253Simp
40145253Simp/*
41145253Simp * Access methods for bus resources and address space.
42145253Simp */
43145253Simpstruct bus_space_tag {
44145253Simp#define	BUS_SPACE_IO	0
45145253Simp#define	BUS_SPACE_MEM	1
46145253Simp	u_int	bs_tag;			/* bus space flags */
47145253Simp
48145253Simp	struct bus_space_access_methods bs_da;	/* direct access */
49145253Simp	struct bus_space_access_methods bs_ra;	/* relocate access */
50145253Simp#if	0
51145253Simp	struct bus_space_access_methods bs_ida;	/* indexed direct access */
52145253Simp#endif
53145253Simp};
54145253Simptypedef struct bus_space_tag *bus_space_tag_t;
55145253Simp
56145253Simp/*
57145253Simp * bus space handle
58145253Simp */
59145253Simpstruct bus_space_handle {
60145253Simp	bus_addr_t	bsh_base;
61145253Simp	size_t		bsh_sz;
62145253Simp
63145253Simp	bus_addr_t	bsh_iat[BUS_SPACE_IAT_MAXSIZE];
64145253Simp	size_t		bsh_maxiatsz;
65145253Simp	size_t		bsh_iatsz;
66145253Simp
67145253Simp	struct resource	**bsh_res;
68145253Simp	size_t		bsh_ressz;
69145253Simp
70145253Simp	struct bus_space_access_methods bsh_bam;
71145253Simp};
72145253Simptypedef struct bus_space_handle *bus_space_handle_t;
73145253Simp
74145253Simp#endif /* PC98_INCLUDE__BUS_H */
75