1 /* $NetBSD: db_machdep.h,v 1.26 2005/12/11 12:17:53 christos Exp $ */
4 * Mach Operating System
5 * Copyright (c) 1992 Carnegie Mellon University
8 * Permission to use, copy, modify and distribute this software and its
9 * documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation.
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
16 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 * Carnegie Mellon requests users of this software to return to
20 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
25 * any improvements or extensions that they make and grant Carnegie Mellon
26 * the rights to redistribute these changes.
30 * Machine-dependent defines for new kernel debugger.
32 #ifndef _M68K_DB_MACHDEP_H_
33 #define _M68K_DB_MACHDEP_H_
35 #include <sys/types.h>
38 * XXX - Would rather not pull in vm headers, but need boolean_t,
39 * at least until boolean_t moves to <sys/types.h> or someplace.
41 #include <uvm/uvm_param.h>
43 #include <machine/frame.h>
44 #include <machine/psl.h>
45 #include <machine/trap.h>
47 typedef vaddr_t db_addr_t
; /* address - unsigned */
48 typedef long db_expr_t
; /* expression - signed */
49 typedef struct trapframe db_regs_t
;
51 extern db_regs_t ddb_regs
; /* register state */
52 #define DDB_REGS (&ddb_regs)
54 #define PC_REGS(regs) ((regs)->tf_pc)
56 #define BKPT_ADDR(addr) (addr) /* breakpoint address */
57 #define BKPT_INST 0x4e4f /* breakpoint instruction */
58 #define BKPT_SIZE (2) /* size of breakpoint inst */
59 #define BKPT_SET(inst, addr) (BKPT_INST)
61 #define FIXUP_PC_AFTER_BREAK(regs) ((regs)->tf_pc -= BKPT_SIZE)
63 #define db_clear_single_step(regs) ((regs)->tf_sr &= ~PSL_T)
64 #define db_set_single_step(regs) ((regs)->tf_sr |= PSL_T)
66 #define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAKPOINT)
68 #define IS_WATCHPOINT_TRAP(type, code) ((type) == T_WATCHPOINT)
70 #define IS_WATCHPOINT_TRAP(type, code) 0
73 #define M_RTS 0xffff0000
74 #define I_RTS 0x4e750000
75 #define M_JSR 0xffc00000
76 #define I_JSR 0x4e800000
77 #define M_BSR 0xff000000
78 #define I_BSR 0x61000000
79 #define M_RTE 0xffff0000
80 #define I_RTE 0x4e730000
82 #define inst_trap_return(ins) (((ins)&M_RTE) == I_RTE)
83 #define inst_return(ins) (((ins)&M_RTS) == I_RTS)
84 #define inst_call(ins) (((ins)&M_JSR) == I_JSR || \
85 ((ins)&M_BSR) == I_BSR)
86 #define inst_load(ins) 0
87 #define inst_store(ins) 0
90 * Things needed by kgdb:
92 typedef long kgdb_reg_t
;
93 #define KGDB_NUMREGS (16+2)
94 #define KGDB_BUFLEN 512
99 void Debugger(void); /* XXX */
100 void kdb_kintr(db_regs_t
*);
101 int kdb_trap(int, db_regs_t
*);
106 * We use either a.out or Elf32 symbols in DDB.
108 #define DB_AOUT_SYMBOLS
109 #define DB_ELF_SYMBOLS
110 #define DB_ELFSIZE 32
112 #endif /* _M68K_DB_MACHDEP_H_ */