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