1 /* defs.h 4.6 86/03/26 */ 2 3 /* 4 * adb - vax string table version; common definitions 5 */ 6 #include <sys/param.h> 7 8 #include <machine/psl.h> 9 #ifdef NEWVM 10 typedef unsigned long Ooff_t; 11 #define off_t Ooff_t 12 #include <hp300/pte.h> 13 #else 14 #include <machine/pte.h> 15 #endif 16 17 #include <sys/user.h> 18 19 #include <ctype.h> 20 #include <a.out.h> 21 #include <sys/ptrace.h> 22 23 #include "mac.h" 24 #include "mode.h" 25 #include "head.h" 26 27 /* access modes */ 28 #define RD 0 29 #define WT 1 30 31 #define NSP 0 32 #define ISP 1 33 #define DSP 2 34 #define STAR 4 35 #define PSP 8 36 #define STARCOM 0200 37 38 #ifdef pdp11 39 I guess I should look this up in the 2.10 source... 40 #endif 41 42 #ifdef vax 43 /* 44 * Symbol types, used internally in calls to findsym routine. 45 * One the VAX this all degenerates since I & D symbols are indistinct. 46 * Basically we get NSYM==0 for `=' command, ISYM==DSYM otherwise. 47 */ 48 #define NSYM 0 49 #define DSYM 1 /* Data space symbol */ 50 #define ISYM DSYM /* Instruction space symbol == DSYM on VAX */ 51 52 #define BKPTSET 1 53 #define BKPTEXEC 2 54 55 #define USERPS PSL 56 #define USERPC PC 57 #define BPT 03 58 #define TBIT 020 59 #define FD 0200 60 #define getradj(i) 0 61 #define lget get 62 63 /* puns from <sys/ptrace.h> */ 64 #define CONTIN PT_CONTINUE 65 #define SINGLE PT_STEP 66 67 /* the quantities involving ctob() are located in the kernel stack. */ 68 /* the others are in the pcb. */ 69 #define KSP 0 70 #define ESP 4 71 #define SSP 8 72 #define USP (ctob(UPAGES)-5*sizeof(int)) 73 74 /* should read this in from reg.h */ 75 #define R0 (ctob(UPAGES)-18*sizeof(int)) 76 #define R1 (ctob(UPAGES)-17*sizeof(int)) 77 #define R2 (ctob(UPAGES)-16*sizeof(int)) 78 #define R3 (ctob(UPAGES)-15*sizeof(int)) 79 #define R4 (ctob(UPAGES)-14*sizeof(int)) 80 #define R5 (ctob(UPAGES)-13*sizeof(int)) 81 #define R6 (ctob(UPAGES)-12*sizeof(int)) 82 #define R7 (ctob(UPAGES)-11*sizeof(int)) 83 #define R8 (ctob(UPAGES)-10*sizeof(int)) 84 #define R9 (ctob(UPAGES)-9*sizeof(int)) 85 #define R10 (ctob(UPAGES)-8*sizeof(int)) 86 #define R11 (ctob(UPAGES)-7*sizeof(int)) 87 #define AP (ctob(UPAGES)-21*sizeof(int)) 88 #define FP (ctob(UPAGES)-20*sizeof(int)) 89 #define PC (ctob(UPAGES)-2*sizeof(int)) 90 #define PSL (ctob(UPAGES)-1*sizeof(int)) 91 92 #define P0BR 80 93 #define P0LR 84 94 #define P1BR 88 95 #define P1LR 92 96 #endif 97 98 #ifdef hp300 99 #define NSYM 0 /* ??? */ 100 #define DSYM 1 /* Data space symbol */ 101 #define ISYM DSYM /* Instruction space symbol */ 102 103 #define BKPTSET 1 104 #define BKPTEXEC 2 105 106 extern L_INT getradj(); 107 108 #define BPT 0x4e42 109 110 /* puns from <sys/ptrace.h> */ 111 #define CONTIN PT_CONTINUE 112 #define SINGLE PT_STEP 113 114 /* 115 * Appropriated from dbx (returning a favor) 116 * `10' comes from: 117 * (4) stack starts 4 bytes in from end of uarea 118 * (2) trap type 0 frame format word is 2 bytes back from that 119 * (4) trap type 0 pc is 4 bytes back from that 120 */ 121 #define regloc(reg) (ctob(UPAGES) + (sizeof(int) * ((reg) - 17)) - 10) 122 123 /* select map */ 124 #define mapptr(s) (((s)&DSP)?&datmap:(((s)&PSP)?&physmap:&txtmap)) 125 126 #define KSP 12 /* who knows? */ 127 128 /* should read this in from reg.h */ 129 #define D0 regloc(0) 130 #define D1 regloc(1) 131 #define D2 regloc(2) 132 #define D3 regloc(3) 133 #define D4 regloc(4) 134 #define D5 regloc(5) 135 #define D6 regloc(6) 136 #define D7 regloc(7) 137 #define A0 regloc(8) 138 #define A1 regloc(9) 139 #define A2 regloc(10) 140 #define A3 regloc(11) 141 #define A4 regloc(12) 142 #define A5 regloc(13) 143 #define A6 regloc(14) 144 #define A7 regloc(15) 145 /* 146 * In 4.4 these have changed, stackadj (pad) field is 4 bytes not 2 147 * so PSW/PC are 2 bytes further away from D0. 148 */ 149 #if defined(BSD4_4) || defined(HPBSD) 150 #define PSW (regloc(16)+2) 151 #define PC (regloc(17)+2) 152 #else 153 #define PSW regloc(16) 154 #define PC regloc(17) 155 #endif 156 #define FP A6 157 #define USP A7 158 159 #define P0BR 60 160 #define P0LR 64 161 #define P1BR 68 162 #define P1LR 72 163 164 #define FP0 332 165 #define FP1 344 166 #define FP2 356 167 #define FP3 368 168 #define FP4 380 169 #define FP5 392 170 #define FP6 404 171 #define FP7 416 172 #define FPCR 428 173 #define FPSR 432 174 #define FPIAR 436 175 #endif 176 177 #if !defined(pdp11) && !defined(vax) && !defined(hp300) 178 179 "edit this file to accommodate your machine's addressing" 180 181 #endif 182 183 #define MAXOFF 255 184 #define MAXPOS 80 185 #define MAXLIN 128 186 #define EOR '\n' 187 #define SP ' ' 188 #define TB '\t' 189 #define QUOTE 0200 190 #define STRIP 0177 191 #define EVEN -2 192 193 /* long to ints and back (puns) */ 194 union { 195 INT I[2]; 196 L_INT L; 197 } itolws; 198 199 #ifdef pdp11 200 #define leng(a) ((long)((unsigned)(a))) 201 #define shorten(a) ((int)(a)) 202 #define itol(a,b) (itolws.I[0]=(a), itolws.I[1]=(b), itolws.L) 203 #define lobyte(a) ((a) & 0377) 204 #endif 205 206 #ifdef vax 207 #define leng(a) itol(0,a) 208 #define shorten(a) ((short)(a)) 209 #define itol(a,b) (itolws.I[0]=(b), itolws.I[1]=(a), itolws.L) 210 #define lobyte(a) ((a) & 0377) 211 #endif 212 213 #ifdef mc68000 214 #define leng(a) itol(0,a) 215 #define shorten(a) ((short)(a)) 216 #define itol(a,b) (itolws.I[0]=(a), itolws.I[1]=(b), itolws.L) 217 #define lobyte(a) (((a) >> 8) & 0377) 218 #endif 219 220 #if !defined(vax) && !defined(pdp11) && !defined(mc68000) 221 222 "edit this file to suit your machine's byte order" 223 224 #endif 225 226 /* result type declarations */ 227 L_INT inkdot(); 228 POS get(); 229 POS chkget(); 230 POS lchkget(); 231 STRING exform(); 232 L_INT round(); 233 BKPTR scanbkpt(); 234 VOID fault(); 235 236 struct pcb pcb; 237 int kernel; 238 int kcore; 239 struct pte *sbr; 240 int slr; 241 int masterpcbb; 242