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