1*53023Sbostic /*- 2*53023Sbostic * Copyright (c) 1992 The Regents of the University of California. 3*53023Sbostic * All rights reserved. 4*53023Sbostic * 5*53023Sbostic * This code is derived from software contributed to Berkeley by 6*53023Sbostic * Ralph Campbell. 7*53023Sbostic * 8*53023Sbostic * %sccs.include.redist.c% 9*53023Sbostic * 10*53023Sbostic * @(#)kdbparam.h 7.1 (Berkeley) 03/19/92 11*53023Sbostic */ 12*53023Sbostic 13*53023Sbostic /* 14*53023Sbostic * Machine dependent definitions for kdb. 15*53023Sbostic */ 16*53023Sbostic 17*53023Sbostic #if BYTE_ORDER == LITTLE_ENDIAN 18*53023Sbostic #define kdbshorten(w) ((w) & 0xFFFF) 19*53023Sbostic #define kdbbyte(w) ((w) & 0xFF) 20*53023Sbostic #define kdbitol(a,b) ((long)(((b) << 16) | ((a) & 0xFFFF))) 21*53023Sbostic #define kdbbtol(a) ((long)(a)) 22*53023Sbostic #endif 23*53023Sbostic 24*53023Sbostic #define LPRMODE "%R" 25*53023Sbostic #define OFFMODE "+%R" 26*53023Sbostic 27*53023Sbostic #define SETBP(ins) MACH_BREAK_BRKPT 28*53023Sbostic 29*53023Sbostic /* return the program counter value modified if we are in a delay slot */ 30*53023Sbostic #define kdbgetpc(pcb) (kdbvar[kdbvarchk('t')] < 0 ? \ 31*53023Sbostic (pcb).pcb_regs[34] + 4 : (pcb).pcb_regs[34]) 32*53023Sbostic #define kdbishiddenreg(p) ((p) >= &kdbreglist[29]) 33*53023Sbostic #define kdbisbreak(type) (((type) & MACH_CR_EXC_CODE) == 0x24) 34*53023Sbostic 35*53023Sbostic /* check for address wrap around */ 36*53023Sbostic #define kdbaddrwrap(addr,newaddr) (((addr)^(newaddr)) >> 31) 37*53023Sbostic 38*53023Sbostic /* declare machine dependent routines defined in kadb.c */ 39*53023Sbostic void kdbprinttrap __P((unsigned, unsigned)); 40*53023Sbostic void kdbsetsstep __P((void)); 41*53023Sbostic void kdbclrsstep __P((void)); 42*53023Sbostic void kdbreadc __P((char *)); 43*53023Sbostic void kdbwrite __P((char *, int)); 44*53023Sbostic void kdbprintins __P((int, long)); 45*53023Sbostic void kdbstacktrace __P((int)); 46*53023Sbostic char *kdbmalloc __P((int)); 47