Annotation of sys/arch/sparc/include/db_machdep.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: db_machdep.h,v 1.13 2005/11/13 17:50:44 fgsch Exp $ */
2: /* $NetBSD: db_machdep.h,v 1.10 1997/08/31 21:23:40 pk Exp $ */
3:
4: /*
5: * Mach Operating System
6: * Copyright (c) 1991,1990 Carnegie Mellon University
7: * All Rights Reserved.
8: *
9: * Permission to use, copy, modify and distribute this software and its
10: * documentation is hereby granted, provided that both the copyright
11: * notice and this permission notice appear in all copies of the
12: * software, derivative works or modified versions, and any portions
13: * thereof, and that both notices appear in supporting documentation.
14: *
15: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
17: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18: *
19: * Carnegie Mellon requests users of this software to return to
20: *
21: * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22: * School of Computer Science
23: * Carnegie Mellon University
24: * Pittsburgh PA 15213-3890
25: *
26: * any improvements or extensions that they make and grant Carnegie Mellon
27: * the rights to redistribute these changes.
28: */
29:
30: #ifndef _SPARC_DB_MACHDEP_H_
31: #define _SPARC_DB_MACHDEP_H_
32:
33: /*
34: * Machine-dependent defines for new kernel debugger.
35: */
36:
37:
38: #include <uvm/uvm_extern.h>
39: #include <machine/frame.h>
40: #include <machine/psl.h>
41: #include <machine/trap.h>
42: #include <machine/reg.h>
43:
44: /* end of mangling */
45:
46: typedef vaddr_t db_addr_t; /* address - unsigned */
47: typedef long db_expr_t; /* expression - signed */
48:
49: typedef struct {
50: struct trapframe db_tf;
51: struct frame db_fr;
52: } db_regs_t;
53:
54: extern db_regs_t ddb_regs; /* register state */
55: #define DDB_REGS (&ddb_regs)
56: #define DDB_TF (&ddb_regs.db_tf)
57: #define DDB_FR (&ddb_regs.db_fr)
58:
59: #define PC_REGS(regs) ((db_addr_t)(regs)->db_tf.tf_pc)
60: #define SET_PC_REGS(regs, value) (regs)->db_tf.tf_pc = (int)(value)
61: #define PC_ADVANCE(regs) do { \
62: int n = (regs)->db_tf.tf_npc; \
63: (regs)->db_tf.tf_pc = n; \
64: (regs)->db_tf.tf_npc = n + 4; \
65: } while(0)
66:
67: #define BKPT_INST 0x91d02001 /* breakpoint instruction */
68: #define BKPT_SIZE (4) /* size of breakpoint inst */
69: #define BKPT_SET(inst) (BKPT_INST)
70:
71: #define db_clear_single_step(regs) (void) (0)
72: #define db_set_single_step(regs) (void) (0)
73:
74: #define IS_BREAKPOINT_TRAP(type, code) \
75: ((type) == T_BREAKPOINT || (type) == T_KGDB_EXEC)
76: #define IS_WATCHPOINT_TRAP(type, code) (0)
77:
78: #define inst_trap_return(ins) ((ins)&0)
79: #define inst_return(ins) ((ins)&0)
80: #define inst_call(ins) ((ins)&0)
81: #define inst_load(ins) 0
82: #define inst_store(ins) 0
83:
84: #define DB_MACHINE_COMMANDS
85:
86: void db_machine_init(void);
87: int kdb_trap(int, struct trapframe *);
88:
89: #define DB_ELF_SYMBOLS
90: #define DB_ELFSIZE 32
91:
92:
93: /*
94: * KGDB definitions
95: */
96: typedef u_long kgdb_reg_t;
97: #define KGDB_NUMREGS 72
98: #define KGDB_BUFLEN 1024
99:
100: #define KGDB_PREPARE fb_unblank()
101: #define KGDB_ENTER __asm("ta %0" :: "n" (T_KGDB_EXEC))
102:
103: #endif /* _SPARC_DB_MACHDEP_H_ */
CVSweb