nexusvar.h revision 88823
168349Sobrien/*-
268349Sobrien * Copyright (c) 2001 by Thomas Moestl <tmm@FreeBSD.org>.
368349Sobrien * All rights reserved.
468349Sobrien *
568349Sobrien * Redistribution and use in source and binary forms, with or without
668349Sobrien * modification, are permitted provided that the following conditions
784685Sobrien * are met:
868349Sobrien * 1. Redistributions of source code must retain the above copyright
968349Sobrien *    notice, this list of conditions and the following disclaimer.
1068349Sobrien * 2. Redistributions in binary form must reproduce the above copyright
11103373Sobrien *    notice, this list of conditions and the following disclaimer in the
12103373Sobrien *    documentation and/or other materials provided with the distribution.
13103373Sobrien *
14103373Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15103373Sobrien * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16103373Sobrien * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17103373Sobrien * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18103373Sobrien * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19103373Sobrien * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20103373Sobrien * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21103373Sobrien * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22103373Sobrien * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
23103373Sobrien * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24103373Sobrien *
25103373Sobrien * $FreeBSD: head/sys/sparc64/include/nexusvar.h 88823 2002-01-02 18:27:13Z tmm $
26103373Sobrien */
27103373Sobrien
28103373Sobrien#ifndef _MACHINE_NEXUSVAR_H_
29103373Sobrien#define _MACHINE_NEXUSVAR_H_
30103373Sobrien
31103373Sobrienenum nexus_ivars {
32103373Sobrien	NEXUS_IVAR_NODE,
33103373Sobrien	NEXUS_IVAR_NAME,
34103373Sobrien	NEXUS_IVAR_DEVICE_TYPE,
35103373Sobrien	NEXUS_IVAR_MODEL,
36103373Sobrien	NEXUS_IVAR_REG,
37103373Sobrien	NEXUS_IVAR_NREG,
38103373Sobrien	NEXUS_IVAR_INTERRUPTS,
39103373Sobrien	NEXUS_IVAR_NINTERRUPTS,
40	NEXUS_IVAR_DMATAG,
41};
42
43/*
44 * Simplified accessors for nexus devices
45 * XXX: These should be made specializations of generic bus accessor macros
46 * instead of having multiple implementations around.
47 */
48#define NEXUS_ACCESSOR(var, ivar, type)					\
49	__BUS_ACCESSOR(nexus, var, NEXUS, ivar, type)
50
51NEXUS_ACCESSOR(node,		NODE,			phandle_t)
52NEXUS_ACCESSOR(name,		NAME,			char *)
53NEXUS_ACCESSOR(device_type,	DEVICE_TYPE,		char *)
54NEXUS_ACCESSOR(model,		MODEL,			char *)
55NEXUS_ACCESSOR(reg,		REG,			struct upa_regs *)
56NEXUS_ACCESSOR(nreg,		NREG,			int)
57NEXUS_ACCESSOR(interrupts,	INTERRUPTS,		u_int *)
58NEXUS_ACCESSOR(ninterrupts,	NINTERRUPTS,		int)
59NEXUS_ACCESSOR(dmatag,		DMATAG,			bus_dma_tag_t)
60
61#undef NEXUS_ACCESSOR
62
63#endif /* _MACHINE_NEXUSVAR_H_ */
64