xref: /csrg-svn/sys/pmax/include/kdbparam.h (revision 63217)
153023Sbostic /*-
2*63217Sbostic  * Copyright (c) 1992, 1993
3*63217Sbostic  *	The Regents of the University of California.  All rights reserved.
453023Sbostic  *
553023Sbostic  * This code is derived from software contributed to Berkeley by
653023Sbostic  * Ralph Campbell.
753023Sbostic  *
853023Sbostic  * %sccs.include.redist.c%
953023Sbostic  *
10*63217Sbostic  *	@(#)kdbparam.h	8.1 (Berkeley) 06/10/93
1153023Sbostic  */
1253023Sbostic 
1353023Sbostic /*
1453023Sbostic  * Machine dependent definitions for kdb.
1553023Sbostic  */
1653023Sbostic 
1753023Sbostic #if BYTE_ORDER == LITTLE_ENDIAN
1853023Sbostic #define kdbshorten(w)	((w) & 0xFFFF)
1953023Sbostic #define	kdbbyte(w)	((w) & 0xFF)
2053023Sbostic #define	kdbitol(a,b)	((long)(((b) << 16) | ((a) & 0xFFFF)))
2153023Sbostic #define	kdbbtol(a)	((long)(a))
2253023Sbostic #endif
2353023Sbostic 
2453023Sbostic #define LPRMODE		"%R"
2553023Sbostic #define OFFMODE		"+%R"
2653023Sbostic 
2753023Sbostic #define	SETBP(ins)	MACH_BREAK_BRKPT
2853023Sbostic 
2953023Sbostic /* return the program counter value modified if we are in a delay slot */
3053023Sbostic #define	kdbgetpc(pcb)		(kdbvar[kdbvarchk('t')] < 0 ? \
3153023Sbostic 	(pcb).pcb_regs[34] + 4 : (pcb).pcb_regs[34])
3253052Sralph #define	kdbishiddenreg(p)	((p) >= &kdbreglist[33])
3353023Sbostic #define	kdbisbreak(type)	(((type) & MACH_CR_EXC_CODE) == 0x24)
3453023Sbostic 
3553023Sbostic /* check for address wrap around */
3653023Sbostic #define	kdbaddrwrap(addr,newaddr)	(((addr)^(newaddr)) >> 31)
3753023Sbostic 
3853023Sbostic /* declare machine dependent routines defined in kadb.c */
3953023Sbostic void	kdbprinttrap __P((unsigned, unsigned));
4053023Sbostic void	kdbsetsstep __P((void));
4153023Sbostic void	kdbclrsstep __P((void));
4253023Sbostic void	kdbreadc __P((char *));
4353023Sbostic void	kdbwrite __P((char *, int));
4453023Sbostic void	kdbprintins __P((int, long));
4553023Sbostic void	kdbstacktrace __P((int));
4653023Sbostic char	*kdbmalloc __P((int));
47