xref: /csrg-svn/sys/vax/include/kdbparam.h (revision 34075)
1 /*
2  *	@(#)kdbparam.h	7.1 (Berkeley) 04/23/88
3  */
4 
5 #include <sys/vm.h>
6 
7 #define DBNAME "kdb\n"
8 #define LPRMODE "%R"
9 #define OFFMODE "+%R"
10 
11 #define	MAXINT	0x7fffffff
12 #define	MAXSTOR (KERNBASE - ctob(UPAGES))
13 
14 #define	ENTRYMASK	1			/* check for entry masks */
15 #define	ishiddenreg(p)	((p) <= &reglist[8])
16 
17 #define BPT	03
18 #define TBIT	020
19 
20 #define	clrsstep()	(pcb.pcb_psl &= ~TBIT)
21 #define	setsstep()	(pcb.pcb_psl |= TBIT)
22 
23 #define	SETBP(ins)	(BPT | ((ins) & ~0xff))
24 
25 #define	getprevpc(fp)	get((fp)+16, DSP)	/* pc of caller */
26 #define	getprevframe(fp) (get((fp)+12, DSP)&~2)	/* fp of caller */
27 #define	getnargs(fp)	(get((fp)+6, DSP)&0xffff)
28 #define	nextarg(ap)	((ap) + 4)		/* next argument in list */
29 #define	NOFRAME		0			/* fp at top of call stack */
30 
31 #define	issignalpc(pc)	(MAXSTOR < (pc) && (pc) < MAXSTOR+ctob(UPAGES))
32 #define	getsignalpc(fp)	get((fp)+92, DSP)	/* pc of caller before signal */
33 
34 /* long to ints and back (puns) */
35 union {
36 	int	I[2];
37 	long	L;
38 } itolws;
39 
40 #define leng(a)		itol(0,a)
41 #define shorten(a)	((short)(a))
42 #define itol(a,b)	(itolws.I[0]=(b), itolws.I[1]=(a), itolws.L)
43 #define	byte(a)		((a) & 0xff)
44 #define	btol(a)		((a))
45 
46 /* check for address wrap around */
47 #define	addrwrap(oaddr,newaddr) (((oaddr)^(newaddr)) >> 24)
48 /*
49  * INSTACK tells whether its argument is a stack address.
50  * INUDOT tells whether its argument is in the (extended) u. area.
51  * These are used for consistency checking and dont have to be exact.
52  *
53  * INKERNEL tells whether its argument is a kernel space address.
54  * KVTOPH trims a kernel virtal address back to its offset
55  * in the kernel address space.
56  */
57 #define	INSTACK(x)	(((x)&0xf0000000) == 0x70000000)
58 #define	INUDOT(x)	(((x)&0xf0000000) == 0x70000000)
59 #define	INKERNEL(x)	(((x)&0xf0000000) == 0x80000000)
60 
61 #define	KVTOPH(x)	((x)&~ 0x80000000)
62 #define	KERNOFF		0x80000000
63