1/* $FreeBSD: head/sys/ia64/include/db_machdep.h 115084 2003-05-16 21:26:42Z marcel $ */
2/* $NetBSD: db_machdep.h,v 1.6 1997/09/06 02:02:25 thorpej Exp $ */
3
4/*
5 * Copyright (c) 1995 Carnegie-Mellon University.
6 * All rights reserved.
7 *
8 * Author: Chris G. Demetriou
9 *
10 * Permission to use, copy, modify and distribute this software and
11 * its documentation is hereby granted, provided that both the copyright
12 * notice and this permission notice appear in all copies of the
13 * software, derivative works or modified versions, and any portions
14 * thereof, and that both notices appear in supporting documentation.
15 *
16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 *
20 * Carnegie Mellon requests users of this software to return to
21 *
22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23 * School of Computer Science
24 * Carnegie Mellon University
25 * Pittsburgh PA 15213-3890
26 *
27 * any improvements or extensions that they make and grant Carnegie the
28 * rights to redistribute these changes.
29 */
30
31#ifndef _MACHINE_DB_MACHDEP_H_
32#define _MACHINE_DB_MACHDEP_H_
33
34/*
35 * Machine-dependent defines for new kernel debugger.
36 */
37
38#include <sys/param.h>
39#include <vm/vm.h>
40#include <machine/frame.h>
41#include <machine/ia64_cpu.h>
42
43#define DB_NO_AOUT
44
45struct ia64_bundle;
46
47typedef vm_offset_t db_addr_t; /* address - unsigned */
48typedef long db_expr_t; /* expression - signed */
49typedef struct trapframe db_regs_t;
50extern db_regs_t ddb_regs; /* register state */
51#define DDB_REGS (&ddb_regs)
52
53#define PC_REGS(regs) ((db_addr_t)(regs)->tf_special.iip + \
54 (((regs)->tf_special.psr >> 41) & 3))
55
56#define BKPT_WRITE(addr, storage) db_write_breakpoint(addr, storage)
57#define BKPT_CLEAR(addr, storage) db_clear_breakpoint(addr, storage)
58#define BKPT_INST_TYPE u_int64_t
59
60#define BKPT_SKIP db_skip_breakpoint()
61
62#define db_clear_single_step(regs) ddb_regs.tf_special.psr &= ~IA64_PSR_SS
63#define db_set_single_step(regs) ddb_regs.tf_special.psr |= IA64_PSR_SS
64
65#define IS_BREAKPOINT_TRAP(type, code) (type == IA64_VEC_BREAK)
66#define IS_WATCHPOINT_TRAP(type, code) 0
67
68#define inst_trap_return(ins) (ins & 0)
69#define inst_return(ins) (ins & 0)
70#define inst_call(ins) (ins & 0)
71#define inst_branch(ins) (ins & 0)
72#define inst_load(ins) (ins & 0)
73#define inst_store(ins) (ins & 0)
74#define inst_unconditional_flow_transfer(ins) (ins & 0)
75
76#define branch_taken(ins, pc, regs) pc
77
78/*
79 * Functions needed for software single-stepping.
80 */
81
82/* No delay slots on Alpha. */
83#define next_instr_address(v, b) ((db_addr_t) ((b) ? (v) : ((v) + 4)))
84
85u_long db_register_value(db_regs_t *, int);
86int kdb_trap(int vector, struct trapframe *regs);
87
88u_int64_t *db_rse_current_frame(void);
89u_int64_t *db_rse_previous_frame(u_int64_t *bsp, int sof);
90u_int64_t *db_rse_register_address(u_int64_t *bsp, int regno);
91
92void db_read_bundle(db_addr_t addr, struct ia64_bundle *bp);
93void db_write_bundle(db_addr_t addr, struct ia64_bundle *bp);
94void db_write_breakpoint(db_addr_t addr, u_int64_t *storage);
95void db_clear_breakpoint(db_addr_t addr, u_int64_t *storage);
96void db_skip_breakpoint(void);
97
98/*
99 * Pretty arbitrary
100 */
101#define DB_SMALL_VALUE_MAX 0x7fffffff
102#define DB_SMALL_VALUE_MIN (-0x400001)
103
104/*
105 * We define some of our own commands.
106 */
107#define DB_MACHINE_COMMANDS
108
109/*
110 * We use Elf64 symbols in DDB.
111 */
112#define DB_ELFSIZE 64
113
114#endif /* _MACHINE_DB_MACHDEP_H_ */
2/* $NetBSD: db_machdep.h,v 1.6 1997/09/06 02:02:25 thorpej Exp $ */
3
4/*
5 * Copyright (c) 1995 Carnegie-Mellon University.
6 * All rights reserved.
7 *
8 * Author: Chris G. Demetriou
9 *
10 * Permission to use, copy, modify and distribute this software and
11 * its documentation is hereby granted, provided that both the copyright
12 * notice and this permission notice appear in all copies of the
13 * software, derivative works or modified versions, and any portions
14 * thereof, and that both notices appear in supporting documentation.
15 *
16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 *
20 * Carnegie Mellon requests users of this software to return to
21 *
22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23 * School of Computer Science
24 * Carnegie Mellon University
25 * Pittsburgh PA 15213-3890
26 *
27 * any improvements or extensions that they make and grant Carnegie the
28 * rights to redistribute these changes.
29 */
30
31#ifndef _MACHINE_DB_MACHDEP_H_
32#define _MACHINE_DB_MACHDEP_H_
33
34/*
35 * Machine-dependent defines for new kernel debugger.
36 */
37
38#include <sys/param.h>
39#include <vm/vm.h>
40#include <machine/frame.h>
41#include <machine/ia64_cpu.h>
42
43#define DB_NO_AOUT
44
45struct ia64_bundle;
46
47typedef vm_offset_t db_addr_t; /* address - unsigned */
48typedef long db_expr_t; /* expression - signed */
49typedef struct trapframe db_regs_t;
50extern db_regs_t ddb_regs; /* register state */
51#define DDB_REGS (&ddb_regs)
52
53#define PC_REGS(regs) ((db_addr_t)(regs)->tf_special.iip + \
54 (((regs)->tf_special.psr >> 41) & 3))
55
56#define BKPT_WRITE(addr, storage) db_write_breakpoint(addr, storage)
57#define BKPT_CLEAR(addr, storage) db_clear_breakpoint(addr, storage)
58#define BKPT_INST_TYPE u_int64_t
59
60#define BKPT_SKIP db_skip_breakpoint()
61
62#define db_clear_single_step(regs) ddb_regs.tf_special.psr &= ~IA64_PSR_SS
63#define db_set_single_step(regs) ddb_regs.tf_special.psr |= IA64_PSR_SS
64
65#define IS_BREAKPOINT_TRAP(type, code) (type == IA64_VEC_BREAK)
66#define IS_WATCHPOINT_TRAP(type, code) 0
67
68#define inst_trap_return(ins) (ins & 0)
69#define inst_return(ins) (ins & 0)
70#define inst_call(ins) (ins & 0)
71#define inst_branch(ins) (ins & 0)
72#define inst_load(ins) (ins & 0)
73#define inst_store(ins) (ins & 0)
74#define inst_unconditional_flow_transfer(ins) (ins & 0)
75
76#define branch_taken(ins, pc, regs) pc
77
78/*
79 * Functions needed for software single-stepping.
80 */
81
82/* No delay slots on Alpha. */
83#define next_instr_address(v, b) ((db_addr_t) ((b) ? (v) : ((v) + 4)))
84
85u_long db_register_value(db_regs_t *, int);
86int kdb_trap(int vector, struct trapframe *regs);
87
88u_int64_t *db_rse_current_frame(void);
89u_int64_t *db_rse_previous_frame(u_int64_t *bsp, int sof);
90u_int64_t *db_rse_register_address(u_int64_t *bsp, int regno);
91
92void db_read_bundle(db_addr_t addr, struct ia64_bundle *bp);
93void db_write_bundle(db_addr_t addr, struct ia64_bundle *bp);
94void db_write_breakpoint(db_addr_t addr, u_int64_t *storage);
95void db_clear_breakpoint(db_addr_t addr, u_int64_t *storage);
96void db_skip_breakpoint(void);
97
98/*
99 * Pretty arbitrary
100 */
101#define DB_SMALL_VALUE_MAX 0x7fffffff
102#define DB_SMALL_VALUE_MIN (-0x400001)
103
104/*
105 * We define some of our own commands.
106 */
107#define DB_MACHINE_COMMANDS
108
109/*
110 * We use Elf64 symbols in DDB.
111 */
112#define DB_ELFSIZE 64
113
114#endif /* _MACHINE_DB_MACHDEP_H_ */