1139825Simp/*-
2103620Sgrehan * Copyright 2002 by Peter Grehan. All rights reserved.
3103620Sgrehan *
4103620Sgrehan * Redistribution and use in source and binary forms, with or without
5103620Sgrehan * modification, are permitted provided that the following conditions
6103620Sgrehan * are met:
7103620Sgrehan * 1. Redistributions of source code must retain the above copyright
8103620Sgrehan *    notice, this list of conditions and the following disclaimer.
9103620Sgrehan * 2. Redistributions in binary form must reproduce the above copyright
10103620Sgrehan *    notice, this list of conditions and the following disclaimer in the
11103620Sgrehan *    documentation and/or other materials provided with the distribution.
12103620Sgrehan * 3. The name of the author may not be used to endorse or promote products
13103620Sgrehan *    derived from this software without specific prior written permission.
14103620Sgrehan *
15103620Sgrehan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16103620Sgrehan * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17103620Sgrehan * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18103620Sgrehan * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19103620Sgrehan * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20103620Sgrehan * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21103620Sgrehan * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22103620Sgrehan * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23103620Sgrehan * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24103620Sgrehan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25103620Sgrehan * SUCH DAMAGE.
26103620Sgrehan *
27103620Sgrehan * $FreeBSD$
28103620Sgrehan */
29103620Sgrehan
30103620Sgrehan#ifndef _PSIM_IOBUSVAR_H_
31103620Sgrehan#define _PSIM_IOBUSVAR_H_
32103620Sgrehan
33103620Sgrehan/*
34103620Sgrehan * Accessors for iobus devices
35103620Sgrehan */
36103620Sgrehan
37103620Sgrehanenum iobus_ivars {
38103620Sgrehan        IOBUS_IVAR_NODE,
39103620Sgrehan        IOBUS_IVAR_NAME,
40103620Sgrehan	IOBUS_IVAR_NREGS,
41103620Sgrehan	IOBUS_IVAR_REGS,
42103620Sgrehan};
43103620Sgrehan
44103620Sgrehan#define IOBUS_ACCESSOR(var, ivar, type)                                 \
45103620Sgrehan        __BUS_ACCESSOR(iobus, var, IOBUS, ivar, type)
46103620Sgrehan
47103620SgrehanIOBUS_ACCESSOR(node,            NODE,                   phandle_t)
48103620SgrehanIOBUS_ACCESSOR(name,            NAME,                   char *)
49103620SgrehanIOBUS_ACCESSOR(nregs,           NREGS,                  u_int)
50103620SgrehanIOBUS_ACCESSOR(regs,            REGS,                   u_int *)
51103620Sgrehan
52103620Sgrehan#undef IOBUS_ACCESSOR
53103620Sgrehan
54103620Sgrehan/*
55103620Sgrehan * Per-device structure.
56103620Sgrehan */
57103620Sgrehanstruct iobus_devinfo {
58103620Sgrehan        phandle_t  id_node;
59103620Sgrehan        char      *id_name;
60103620Sgrehan        int        id_interrupt;
61103620Sgrehan	u_int      id_nregs;
62103620Sgrehan	u_int      id_reg[24];
63103620Sgrehan        struct resource_list id_resources;
64103620Sgrehan};
65103620Sgrehan
66103620Sgrehan#endif /* _PSIM_IOBUSVAR_H_ */
67