xref: /original-bsd/old/adb/adb.tahoe/defs.h (revision 01b385eb)
1*01b385ebSsam /*	defs.h	1.3	86/11/20	*/
216d669d6Ssam 
316d669d6Ssam /*
416d669d6Ssam  * adb - vax string table version; common definitions
516d669d6Ssam  */
616d669d6Ssam 
716d669d6Ssam #include <sys/param.h>
816d669d6Ssam #include <sys/dir.h>
916d669d6Ssam #include <machine/psl.h>
1016d669d6Ssam #include <machine/pte.h>
1116d669d6Ssam #include <sys/user.h>
1216d669d6Ssam #include <ctype.h>
1316d669d6Ssam #include <a.out.h>
1416d669d6Ssam 
1516d669d6Ssam #include "mac.h"
1616d669d6Ssam #include "mode.h"
1716d669d6Ssam #include "head.h"
1816d669d6Ssam 
1916d669d6Ssam /* access modes */
2016d669d6Ssam #define RD	0
2116d669d6Ssam #define WT	1
2216d669d6Ssam 
2316d669d6Ssam #define NSP	0
2416d669d6Ssam #define	ISP	1
2516d669d6Ssam #define	DSP	2
2616d669d6Ssam #define STAR	4
2716d669d6Ssam 
2816d669d6Ssam /*
2916d669d6Ssam  * Symbol types, used internally in calls to findsym routine.
3016d669d6Ssam  * One the VAX this all degenerates since I & D symbols are indistinct.
3116d669d6Ssam  * Basically we get NSYM==0 for `=' command, ISYM==DSYM otherwise.
3216d669d6Ssam  */
3316d669d6Ssam #define NSYM	0
3416d669d6Ssam #define DSYM	1		/* Data space symbol */
3516d669d6Ssam #define ISYM	DSYM		/* Instruction space symbol == DSYM on VAX */
3616d669d6Ssam 
3716d669d6Ssam #define BKPTSET	1
3816d669d6Ssam #define BKPTEXEC 2
3916d669d6Ssam 
4016d669d6Ssam #define BPT	0x30
4116d669d6Ssam #define KCALL	0xcf
4216d669d6Ssam #define CASEL	0xfc
4316d669d6Ssam #define TBIT	0x10
4416d669d6Ssam #define	SETTRC	0
4516d669d6Ssam #define	RDUSER	2
4616d669d6Ssam #define	RIUSER	1
4716d669d6Ssam #define	WDUSER	5
4816d669d6Ssam #define WIUSER	4
4916d669d6Ssam #define	RUREGS	3
5016d669d6Ssam #define	WUREGS	6
5116d669d6Ssam #define	CONTIN	7
5216d669d6Ssam #define	EXIT	8
5316d669d6Ssam #define SINGLE	9
5416d669d6Ssam 
5516d669d6Ssam /* the quantities involving ctob() are located in the kernel stack. */
5616d669d6Ssam /* the others are in the pcb. */
5716d669d6Ssam #define KSP	0
5816d669d6Ssam #define USP	(ctob(UPAGES)-9*sizeof (int))
5916d669d6Ssam #define R0	(ctob(UPAGES)-25*sizeof (int))
6016d669d6Ssam #define R1	(ctob(UPAGES)-24*sizeof (int))
6116d669d6Ssam #define R2	(ctob(UPAGES)-23*sizeof (int))
6216d669d6Ssam #define R3	(ctob(UPAGES)-22*sizeof (int))
6316d669d6Ssam #define R4	(ctob(UPAGES)-21*sizeof (int))
6416d669d6Ssam #define R5	(ctob(UPAGES)-20*sizeof (int))
6516d669d6Ssam #define R6	(ctob(UPAGES)-19*sizeof (int))
6616d669d6Ssam #define R7	(ctob(UPAGES)-18*sizeof (int))
6716d669d6Ssam #define R8	(ctob(UPAGES)-17*sizeof (int))
6816d669d6Ssam #define R9	(ctob(UPAGES)-16*sizeof (int))
6916d669d6Ssam #define R10	(ctob(UPAGES)-15*sizeof (int))
7016d669d6Ssam #define R11	(ctob(UPAGES)-14*sizeof (int))
7116d669d6Ssam #define R12	(ctob(UPAGES)-13*sizeof (int))
7216d669d6Ssam #define FP	(ctob(UPAGES)-10*sizeof (int))
7316d669d6Ssam #define PC	(ctob(UPAGES)-2*sizeof (int))
7416d669d6Ssam #define PSL	(ctob(UPAGES)-1*sizeof (int))
7516d669d6Ssam #define P0BR	72
7616d669d6Ssam #define P0LR	76
7716d669d6Ssam #define P1BR	80
7816d669d6Ssam #define P1LR	84
7916d669d6Ssam #define P2BR	88
8016d669d6Ssam #define P2LR	92
8116d669d6Ssam #define ACHI	(ctob(UPAGES)-6*sizeof (int))
8216d669d6Ssam #define ACLO	(ctob(UPAGES)-7*sizeof (int))
8316d669d6Ssam #define HFS	(ctob(UPAGES)-8*sizeof (int))
8416d669d6Ssam 
8516d669d6Ssam #define MAXOFF	1024
8616d669d6Ssam #define MAXPOS	80
878a60ea4aSsam #define MAXLIN	256
8816d669d6Ssam #define QUOTE	0200
8916d669d6Ssam #define ALIGN	-4
9016d669d6Ssam 
9116d669d6Ssam #ifndef vax
9216d669d6Ssam #define leng(a)		((long)((unsigned)(a)))
9316d669d6Ssam #define shorten(a)	(((a) >> 16) & 0xffff)
9416d669d6Ssam #define	itol(a,b)	(((a) << 16) | ((b) & 0xffff))
9516d669d6Ssam #define	byte(a)		(((a) >> 24) & 0xff)
96*01b385ebSsam #define	btol(a)		((a) << 24)
9716d669d6Ssam #else
9816d669d6Ssam #define leng(a)		itol(0,a)
9916d669d6Ssam #define	shorten(a)	((a) & 0xffff)
10016d669d6Ssam #define	itol(a,b)	(((a) & 0xffff) | ((b) << 16))
10116d669d6Ssam #define	byte(a)		((a) & 0xff)
102*01b385ebSsam #define	btol(a)		(a)
10316d669d6Ssam #endif
10416d669d6Ssam 
10516d669d6Ssam /* result type declarations */
10616d669d6Ssam L_INT		inkdot();
10716d669d6Ssam POS		get();
10816d669d6Ssam POS		chkget();
10916d669d6Ssam STRING		exform();
11016d669d6Ssam L_INT		round();
11116d669d6Ssam BKPTR		scanbkpt();
11216d669d6Ssam VOID		fault();
11316d669d6Ssam 
11416d669d6Ssam struct	pcb	pcb;
11516d669d6Ssam int	kernel;
11616d669d6Ssam int	kcore;
11716d669d6Ssam struct	pte *sbr;
11816d669d6Ssam int	slr;
11916d669d6Ssam int	masterpcbb;
120