xref: /original-bsd/sys/vax/stand/savax.h (revision 5780f38f)
1 /*
2  * Copyright (c) 1982, 1986 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)savax.h	7.2 (Berkeley) 02/21/87
7  */
8 
9 /*
10  * Standalone definitions peculiar to vaxen
11  * The mba devices in the standalone system are addressed as
12  *	xx(unit,section)
13  * where unit is
14  *	8*mbanum+drive
15  * The mbadrv macro gives the address of the device registers
16  * for the specified unit; the mbamba macro gives the address of the
17  * mba registers themselves.
18  *
19  * The uba devices are also addressed by giving, as unit,
20  *	8*ubanum+drive
21  * The ubamem macro converts a specified unibus address (ala pdp-11)
22  * into a unibus memory address space address.
23  */
24 
25 int	cpu;		/* see <sys/cpu.h> */
26 
27 #define	MAXNMBA	8
28 #define	MAXNUBA	8
29 struct	mba_regs **mbaddr;
30 int	mbaact;
31 caddr_t	*umaddr;
32 struct	uba_regs **ubaddr;
33 
34 #define	UNITTOMBA(unit)		((unit)>>3)
35 #define	UNITTODRIVE(unit)	((unit)&07)
36 
37 #define	mbamba(unit)		(mbaddr[UNITTOMBA(unit)])
38 #define	mbadrv(unit) 		(&mbamba(unit)->mba_drv[UNITTODRIVE(unit)])
39 
40 #define	UNITTOUBA(unit)		((unit)>>3)
41 #define	ubauba(unit)		(ubaddr[UNITTOUBA(unit)])
42 #define	ubamem(unit, off)	(umaddr[UNITTOUBA(unit)] + \
43 					(0760000 | ubdevreg(off)))
44 
45 /*
46  * RM03/5 (4-byte header plus CRC) format information:
47  * codes for sector header word 1
48  */
49 #define	HDR1_FMT22	0x1000	/* standard 16 bit format */
50 #define	HDR1_OKSCT	0xc000	/* sector ok */
51 #define	HDR1_SSF	0x2000	/* skip sector flag */
52