xref: /original-bsd/sys/sparc/sbus/sbusreg.h (revision 7d5966cc)
1 /*
2  * Copyright (c) 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This software was developed by the Computer Systems Engineering group
6  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7  * contributed to Berkeley.
8  *
9  * %sccs.include.redist.c%
10  *
11  *	@(#)sbusreg.h	7.1 (Berkeley) 07/13/92
12  *
13  * from: $Header: sbusreg.h,v 1.5 92/06/17 06:59:44 torek Exp $ (LBL)
14  */
15 
16 /*
17  * Sun-4c S-bus definitions.  (Should be made generic!)
18  *
19  * Sbus slot 0 is not a separate slot; it talks to the onboard I/O devices.
20  * It is, however, addressed just like any `real' Sbus.
21  *
22  * Sbus device addresses are obtained from the FORTH PROMs.  They come
23  * in `absolute' and `relative' address flavors, so we have to handle both.
24  * Relative addresses do *not* include the slot number.
25  */
26 #define	SBUS_BASE		0xf8000000
27 #define	SBUS_ADDR(slot, off)	(SBUS_BASE + ((slot) << 25) + (off))
28 #define	SBUS_ABS(a)		((unsigned)(a) >= SBUS_BASE)
29 #define	SBUS_ABS_TO_SLOT(a)	(((a) - SBUS_BASE) >> 25)
30 #define	SBUS_ABS_TO_OFFSET(a)	(((a) - SBUS_BASE) & 0x1ffffff)
31