xref: /original-bsd/old/adb/adb.vax/defs.h (revision d6141097)
1 /*	defs.h	4.2	81/05/14	*/
2 
3 /*
4  * adb - vax string table version; common definitions
5  */
6 
7 #include <sys/param.h>
8 #include <sys/dir.h>
9 #include <sys/psl.h>
10 #include <sys/pte.h>
11 #include <sys/user.h>
12 #include <ctype.h>
13 #include <a.out.h>
14 
15 #include "mac.h"
16 #include "mode.h"
17 #include "head.h"
18 
19 /* access modes */
20 #define RD	0
21 #define WT	1
22 
23 #define NSP	0
24 #define	ISP	1
25 #define	DSP	2
26 #define STAR	4
27 #define STARCOM 0200
28 
29 /*
30  * Symbol types, used internally in calls to findsym routine.
31  * One the VAX this all degenerates since I & D symbols are indistinct.
32  * Basically we get NSYM==0 for `=' command, ISYM==DSYM otherwise.
33  */
34 #define NSYM	0
35 #define DSYM	1		/* Data space symbol */
36 #define ISYM	DSYM		/* Instruction space symbol == DSYM on VAX */
37 
38 #define BKPTSET	1
39 #define BKPTEXEC 2
40 
41 #define USERPS	PSL
42 #define USERPC	PC
43 #define BPT	03
44 #define TBIT	020
45 #define FD	0200
46 #define	SETTRC	0
47 #define	RDUSER	2
48 #define	RIUSER	1
49 #define	WDUSER	5
50 #define WIUSER	4
51 #define	RUREGS	3
52 #define	WUREGS	6
53 #define	CONTIN	7
54 #define	EXIT	8
55 #define SINGLE	9
56 
57 /* the quantities involving ctob() are located in the kernel stack. */
58 /* the others are in the pcb. */
59 #define KSP	0
60 #define ESP	4
61 #define SSP	8
62 #define USP	(ctob(UPAGES)-5*sizeof(int))
63 #define R0	(ctob(UPAGES)-18*sizeof(int))
64 #define R1	(ctob(UPAGES)-17*sizeof(int))
65 #define R2	(ctob(UPAGES)-16*sizeof(int))
66 #define R3	(ctob(UPAGES)-15*sizeof(int))
67 #define R4	(ctob(UPAGES)-14*sizeof(int))
68 #define R5	(ctob(UPAGES)-13*sizeof(int))
69 #define R6	(ctob(UPAGES)-12*sizeof(int))
70 #define R7	(ctob(UPAGES)-11*sizeof(int))
71 #define R8	(ctob(UPAGES)-10*sizeof(int))
72 #define R9	(ctob(UPAGES)-9*sizeof(int))
73 #define R10	(ctob(UPAGES)-8*sizeof(int))
74 #define R11	(ctob(UPAGES)-7*sizeof(int))
75 #define AP	(ctob(UPAGES)-21*sizeof(int))
76 #define FP	(ctob(UPAGES)-20*sizeof(int))
77 #define PC	(ctob(UPAGES)-2*sizeof(int))
78 #define PSL	(ctob(UPAGES)-1*sizeof(int))
79 #define P0BR	80
80 #define P0LR	84
81 #define P1BR	88
82 #define P1LR	92
83 
84 #define MAXOFF	255
85 #define MAXPOS	80
86 #define MAXLIN	128
87 #define EOF	0
88 #define EOR	'\n'
89 #define SP	' '
90 #define TB	'\t'
91 #define QUOTE	0200
92 #define STRIP	0177
93 #define LOBYTE	0377
94 #define EVEN	-2
95 
96 /* long to ints and back (puns) */
97 union {
98 	INT	I[2];
99 	L_INT	L;
100 } itolws;
101 
102 #ifndef vax
103 #define leng(a)		((long)((unsigned)(a)))
104 #define shorten(a)	((int)(a))
105 #define itol(a,b)	(itolws.I[0]=(a), itolws.I[1]=(b), itolws.L)
106 #else
107 #define leng(a)		itol(0,a)
108 #define shorten(a)	((short)(a))
109 #define itol(a,b)	(itolws.I[0]=(b), itolws.I[1]=(a), itolws.L)
110 #endif
111 
112 /* result type declarations */
113 L_INT		inkdot();
114 POS		get();
115 POS		chkget();
116 STRING		exform();
117 L_INT		round();
118 BKPTR		scanbkpt();
119 VOID		fault();
120 
121 struct	pcb	pcb;
122 int	kernel;
123 int	kcore;
124 struct	pte *sbr;
125 int	slr;
126 int	masterpcbb;
127