xref: /csrg-svn/sys/tahoe/include/kdbparam.h (revision 34407)
1*34407Skarels /*
2*34407Skarels  * Copyright (c) 1988 Regents of the University of California.
3*34407Skarels  * All rights reserved.  The Berkeley software License Agreement
4*34407Skarels  * specifies the terms and conditions for redistribution.
5*34407Skarels  *
6*34407Skarels  *	@(#)kdbparam.h	7.7 (Berkeley) 05/21/88
7*34407Skarels  */
830114Ssam 
930114Ssam #define DBNAME "kdb\n"
1030114Ssam #define LPRMODE "%R"
1130114Ssam #define OFFMODE "+%R"
1230114Ssam 
1330114Ssam #define	MAXINT	0x7fffffff
1430114Ssam #define	MAXSTOR (KERNBASE - ctob(UPAGES))
1530114Ssam 
1630134Ssam #define	ENTRYMASK	1			/* check for entry masks */
1730135Ssam #define	ishiddenreg(p)	((p) <= &reglist[8])
1830134Ssam 
1930114Ssam #define BPT	0x30
2030114Ssam #define KCALL	0xcf
2130114Ssam #define CASEL	0xfc
2230114Ssam #define TBIT	0x10
2330114Ssam 
2430628Skarels #define	KDB_IPL		0xf	/* highest priority software interrupt */
2530628Skarels #define	setsoftkdb()	mtpr(SIRR, KDB_IPL)
2630628Skarels 
2730134Ssam #define	clrsstep()	(pcb.pcb_psl &= ~TBIT)
2830134Ssam #define	setsstep()	(pcb.pcb_psl |= TBIT)
2930134Ssam 
3030114Ssam #define	SETBP(ins)	((BPT<<24) | ((ins) & 0xffffff))
3130114Ssam 
3230297Ssam #define	getprevpc(fp)	get((off_t)(fp)-8, DSP)	/* pc of caller */
3330297Ssam #define	getprevframe(fp) (get((off_t)(fp), DSP)&~3)	/* fp of caller */
3430297Ssam #define	getnargs(fp)	(((get((off_t)(fp)-4, DSP)&0xffff)-4)/4)
3530134Ssam #define	nextarg(ap)	((ap) + 4)		/* next argument in list */
3630134Ssam #define	NOFRAME		0			/* fp at top of call stack */
3730114Ssam 
3830297Ssam #define	issignalpc(pc)	((unsigned)MAXSTOR < (pc) && (pc) < (unsigned)KERNBASE)
3930297Ssam #define	getsignalpc(fp)	get((off_t)(fp)+44, DSP)/* pc of caller before signal */
4030134Ssam 
4130114Ssam #define leng(a)		((long)((unsigned)(a)))
4230114Ssam #define shorten(a)	(((a) >> 16) & 0xffff)
4330297Ssam #define	itol(a,b)	((long)(((a) << 16) | ((b) & 0xffff)))
4430114Ssam #define	byte(a)		(((a) >> 24) & 0xff)
4530297Ssam #define	btol(a)		((long)((a) << 24))
4630114Ssam 
4730134Ssam /* check for address wrap around */
4830134Ssam #define	addrwrap(oaddr,newaddr) \
4930134Ssam 	(((oaddr)^(newaddr)) >> 24)
5030114Ssam /*
5130114Ssam  * INSTACK tells whether its argument is a stack address.
5230114Ssam  * INUDOT tells whether its argument is in the (extended) u. area.
5330114Ssam  * These are used for consistency checking and dont have to be exact.
5430114Ssam  *
5530114Ssam  * INKERNEL tells whether its argument is a kernel space address.
5630114Ssam  * KVTOPH trims a kernel virtal address back to its offset
5730114Ssam  * in the kernel address space.
5830114Ssam  */
5930114Ssam #define	INSTACK(x)	(((int)(x)&0xf0000000) == 0xb0000000)
6030114Ssam #define	INUDOT(x)	(((int)(x)&0xf0000000) == 0xb0000000)
6130114Ssam #define	INKERNEL(x)	(((int)(x)&0xf0000000) == 0xc0000000)
6230114Ssam 
6330114Ssam #define	KERNOFF		(KERNBASE + 0x800)	/* start of kernel's text */
6430628Skarels /* #define	KVTOPH(x)	((x)&~ 0xc0000000) sometimes */
65