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.9 (Berkeley) 05/08/91 8 */ 9 10 #define DBNAME "kdb\n" 11 #define LPRMODE "%R" 12 #define OFFMODE "+%R" 13 14 #define MAXINT 0x7fffffff 15 #define MAXSTOR (KERNBASE - ctob(UPAGES)) 16 17 #define ENTRYMASK 1 /* check for entry masks */ 18 #define ishiddenreg(p) ((p) <= &kdbreglist[8]) 19 20 #define BPT 0x30 21 #define KCALL 0xcf 22 #define CASEL 0xfc 23 #define TBIT 0x10 24 25 #define KDB_IPL 0xf /* highest priority software interrupt */ 26 #define setsoftkdb() mtpr(SIRR, KDB_IPL) 27 28 #define clrsstep() (kdbpcb.pcb_psl &= ~TBIT) 29 #define setsstep() (kdbpcb.pcb_psl |= TBIT) 30 31 #define SETBP(ins) ((BPT<<24) | ((ins) & 0xffffff)) 32 33 #define getprevpc(fp) kdbget((off_t)(fp)-8, DSP) /* pc of caller */ 34 #define getprevframe(fp) (kdbget((off_t)(fp), DSP)&~3) /* fp of caller */ 35 #define getnargs(fp) (((kdbget((off_t)(fp)-4, DSP)&0xffff)-4)/4) 36 #define nextarg(ap) ((ap) + 4) /* next argument in list */ 37 #define NOFRAME 0 /* fp at top of call stack */ 38 39 #define issignalpc(pc) ((unsigned)MAXSTOR < (pc) && (pc) < (unsigned)KERNBASE) 40 #define getsignalpc(fp) kdbget((off_t)(fp)+44, DSP)/* pc of caller before signal */ 41 42 #define leng(a) ((long)((unsigned)(a))) 43 #define shorten(a) (((a) >> 16) & 0xffff) 44 #define itol(a,b) ((long)(((a) << 16) | ((b) & 0xffff))) 45 #define byte(a) (((a) >> 24) & 0xff) 46 #define btol(a) ((long)((a) << 24)) 47 48 /* check for address wrap around */ 49 #define addrwrap(oaddr,newaddr) \ 50 (((oaddr)^(newaddr)) >> 24) 51 /* 52 * INSTACK tells whether its argument is a stack address. 53 * INUDOT tells whether its argument is in the (extended) u. area. 54 * These are used for consistency checking and dont have to be exact. 55 * 56 * INKERNEL tells whether its argument is a kernel space address. 57 * KVTOPH trims a kernel virtal address back to its offset 58 * in the kernel address space. 59 */ 60 #define INSTACK(x) (((int)(x)&0xf0000000) == 0xb0000000) 61 #define INUDOT(x) (((int)(x)&0xf0000000) == 0xb0000000) 62 #define INKERNEL(x) (((int)(x)&0xf0000000) == 0xc0000000) 63 64 #define KERNOFF (KERNBASE + 0x800) /* start of kernel's text */ 65 /* #define KVTOPH(x) ((x)&~ 0xc0000000) sometimes */ 66