lint
[unix-history] / usr / src / sys / tahoe / include / kdbparam.h
CommitLineData
9d61b7ff 1/* kdbparam.h 7.5 86/12/15 */
465dab34
SL
2
3#include <sys/vm.h>
4
5#define DBNAME "kdb\n"
6#define LPRMODE "%R"
7#define OFFMODE "+%R"
8
9#define MAXINT 0x7fffffff
10#define MAXSTOR (KERNBASE - ctob(UPAGES))
11
31ff90a8 12#define ENTRYMASK 1 /* check for entry masks */
c16f68ae 13#define ishiddenreg(p) ((p) <= &reglist[8])
31ff90a8 14
465dab34
SL
15#define BPT 0x30
16#define KCALL 0xcf
17#define CASEL 0xfc
18#define TBIT 0x10
19
31ff90a8
SL
20#define clrsstep() (pcb.pcb_psl &= ~TBIT)
21#define setsstep() (pcb.pcb_psl |= TBIT)
22
465dab34
SL
23#define SETBP(ins) ((BPT<<24) | ((ins) & 0xffffff))
24
9d61b7ff
SL
25#define getprevpc(fp) get((off_t)(fp)-8, DSP) /* pc of caller */
26#define getprevframe(fp) (get((off_t)(fp), DSP)&~3) /* fp of caller */
27#define getnargs(fp) (((get((off_t)(fp)-4, DSP)&0xffff)-4)/4)
31ff90a8
SL
28#define nextarg(ap) ((ap) + 4) /* next argument in list */
29#define NOFRAME 0 /* fp at top of call stack */
30
9d61b7ff
SL
31#define issignalpc(pc) ((unsigned)MAXSTOR < (pc) && (pc) < (unsigned)KERNBASE)
32#define getsignalpc(fp) get((off_t)(fp)+44, DSP)/* pc of caller before signal */
465dab34
SL
33
34#define leng(a) ((long)((unsigned)(a)))
35#define shorten(a) (((a) >> 16) & 0xffff)
9d61b7ff 36#define itol(a,b) ((long)(((a) << 16) | ((b) & 0xffff)))
465dab34 37#define byte(a) (((a) >> 24) & 0xff)
9d61b7ff 38#define btol(a) ((long)((a) << 24))
465dab34 39
31ff90a8
SL
40/* check for address wrap around */
41#define addrwrap(oaddr,newaddr) \
42 (((oaddr)^(newaddr)) >> 24)
465dab34
SL
43/*
44 * INSTACK tells whether its argument is a stack address.
45 * INUDOT tells whether its argument is in the (extended) u. area.
46 * These are used for consistency checking and dont have to be exact.
47 *
48 * INKERNEL tells whether its argument is a kernel space address.
49 * KVTOPH trims a kernel virtal address back to its offset
50 * in the kernel address space.
51 */
52#define INSTACK(x) (((int)(x)&0xf0000000) == 0xb0000000)
53#define INUDOT(x) (((int)(x)&0xf0000000) == 0xb0000000)
54#define INKERNEL(x) (((int)(x)&0xf0000000) == 0xc0000000)
55
56#define KERNBASE 0xc0000000
57#define KERNOFF (KERNBASE + 0x800) /* start of kernel's text */
58#define KVTOPH(x) ((x)&~ 0xc0000000)