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