Deleted Added
sdiff udiff text old ( 92124 ) new ( 96912 )
full compact
1/* $FreeBSD: head/sys/ia64/include/db_machdep.h 92124 2002-03-12 00:19:14Z peter $ */
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 _ALPHA_DB_MACHDEP_H_
32#define _ALPHA_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
42#define DB_NO_AOUT
43
44struct ia64_bundle;
45
46typedef vm_offset_t db_addr_t; /* address - unsigned */
47typedef long db_expr_t; /* expression - signed */
48typedef struct trapframe db_regs_t;
49extern db_regs_t ddb_regs; /* register state */
50#define DDB_REGS (&ddb_regs)
51
52#define PC_REGS(regs) ((db_addr_t)(regs)->tf_cr_iip \
53 + (((regs)->tf_cr_ipsr >> 41) & 3))
54
55#define BKPT_WRITE(addr, storage) db_write_breakpoint(addr, storage)
56#define BKPT_CLEAR(addr, storage) db_clear_breakpoint(addr, storage)
57#define BKPT_INST_TYPE u_int64_t
58
59#define BKPT_SKIP db_skip_breakpoint()
60
61#define db_clear_single_step(regs) ddb_regs.tf_cr_ipsr &= ~IA64_PSR_SS
62#define db_set_single_step(regs) ddb_regs.tf_cr_ipsr |= IA64_PSR_SS
63
64#define IS_BREAKPOINT_TRAP(type, code) (type == IA64_VEC_BREAK)
65#define IS_WATCHPOINT_TRAP(type, code) 0
66
67#define inst_trap_return(ins) (ins & 0)
68#define inst_return(ins) (ins & 0)
69#define inst_call(ins) (ins & 0)
70#define inst_branch(ins) (ins & 0)
71#define inst_load(ins) (ins & 0)
72#define inst_store(ins) (ins & 0)
73#define inst_unconditional_flow_transfer(ins) (ins & 0)
74
75#define branch_taken(ins, pc, regs) pc
76
77/*
78 * Functions needed for software single-stepping.
79 */
80
81/* No delay slots on Alpha. */
82#define next_instr_address(v, b) ((db_addr_t) ((b) ? (v) : ((v) + 4)))
83
84u_long db_register_value(db_regs_t *, int);
85int kdb_trap(int vector, struct trapframe *regs);
86
87u_int64_t *db_rse_current_frame(void);
88u_int64_t *db_rse_previous_frame(u_int64_t *bsp, int sof);
89u_int64_t *db_rse_register_address(u_int64_t *bsp, int regno);
90
91void db_read_bundle(db_addr_t addr, struct ia64_bundle *bp);
92void db_write_bundle(db_addr_t addr, struct ia64_bundle *bp);
93void db_write_breakpoint(db_addr_t addr, u_int64_t *storage);
94void db_clear_breakpoint(db_addr_t addr, u_int64_t *storage);
95void db_skip_breakpoint(void);
96
97/*
98 * Pretty arbitrary
99 */
100#define DB_SMALL_VALUE_MAX 0x7fffffff
101#define DB_SMALL_VALUE_MIN (-0x400001)
102
103/*
104 * We define some of our own commands.
105 */
106#define DB_MACHINE_COMMANDS
107
108/*
109 * We use Elf64 symbols in DDB.
110 */
111#define DB_ELFSIZE 64
112
113#endif /* _ALPHA_DB_MACHDEP_H_ */