1 /*- 2 * Copyright (c) 1988 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.proprietary.c% 6 * 7 * @(#)kdbparam.h 7.4 (Berkeley) 05/08/91 8 */ 9 10 #define DBNAME "kdb\n" 11 #define LPRMODE "%R" 12 #define OFFMODE "+%R" 13 14 #define KDB_IPL 0xf /* highest priority software interrupt */ 15 #define setsoftkdb() mtpr(SIRR, KDB_IPL) 16 17 #define MAXINT 0x7fffffff 18 #define MAXSTOR (KERNBASE - ctob(UPAGES)) 19 20 #define ENTRYMASK 1 /* check for entry masks */ 21 #define ishiddenreg(p) ((p) <= &kdbreglist[8]) 22 23 #define BPT 03 24 #define TBIT 020 25 26 #define clrsstep() (kdbpcb.pcb_psl &= ~TBIT) 27 #define setsstep() (kdbpcb.pcb_psl |= TBIT) 28 29 #define SETBP(ins) (BPT | ((ins) & ~0xff)) 30 31 #define getprevpc(fp) kdbget((fp)+16, DSP) /* pc of caller */ 32 #define getprevframe(fp) (kdbget((fp)+12, DSP)&~2) /* fp of caller */ 33 #define NOFRAME 0 /* fp at top of call stack */ 34 35 #define issignalpc(pc) (MAXSTOR < (pc) && (pc) < MAXSTOR+ctob(UPAGES)) 36 #define getsignalpc(fp) kdbget((fp)+92, DSP) /* pc of caller before signal */ 37 38 /* long to ints and back (puns) */ 39 union { 40 int I[2]; 41 long L; 42 } itolws; 43 44 #define leng(a) itol(0,a) 45 #define shorten(a) ((short)(a)) 46 #define itol(a,b) (itolws.I[0]=(b), itolws.I[1]=(a), itolws.L) 47 #define byte(a) ((a) & 0xff) 48 #define btol(a) ((a)) 49 50 /* check for address wrap around */ 51 #define addrwrap(oaddr,newaddr) (((oaddr)^(newaddr)) >> 24) 52 /* 53 * INSTACK tells whether its argument is a stack address. 54 * INUDOT tells whether its argument is in the (extended) u. area. 55 * These are used for consistency checking and dont have to be exact. 56 * 57 * INKERNEL tells whether its argument is a kernel space address. 58 * KVTOPH trims a kernel virtal address back to its offset 59 * in the kernel address space. 60 */ 61 #define INSTACK(x) (((x)&0xf0000000) == 0x70000000) 62 #define INUDOT(x) (((x)&0xf0000000) == 0x70000000) 63 #define INKERNEL(x) (((x)&0xf0000000) == 0x80000000) 64 65 #define KVTOPH(x) ((x)&~ 0x80000000) 66 #define KERNOFF 0x80000000 67