db_machdep.h revision 75666
1/* $FreeBSD: head/sys/ia64/include/db_machdep.h 75666 2001-04-18 14:15:45Z dfr $ */
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
44typedef	vm_offset_t	db_addr_t;	/* address - unsigned */
45typedef	long		db_expr_t;	/* expression - signed */
46typedef struct trapframe db_regs_t;
47db_regs_t		ddb_regs;	/* register state */
48#define	DDB_REGS	(&ddb_regs)
49
50#define	PC_REGS(regs)	((db_addr_t)(regs)->tf_cr_iip \
51			 + (((regs)->tf_cr_ipsr >> 41) & 3))
52
53#define	BKPT_INST	0x00000080	/* breakpoint instruction */
54#define	BKPT_SIZE	(4)		/* size of breakpoint inst */
55#define	BKPT_SET(inst)	(BKPT_INST)
56
57#define	FIXUP_PC_AFTER_BREAK
58
59#define db_clear_single_step(regs)	0
60#define db_set_single_step(regs)	0
61
62#define	IS_BREAKPOINT_TRAP(type, code)	0
63#define	IS_WATCHPOINT_TRAP(type, code)	0
64
65#define	inst_trap_return(ins)	0
66#define	inst_return(ins)	0
67#define	inst_call(ins)		0
68#define	inst_branch(ins)	0
69#define	inst_load(ins)		0
70#define	inst_store(ins)		0
71#define	inst_unconditional_flow_transfer(ins) 0
72
73#define	branch_taken(ins, pc, regs) pc
74
75/*
76 * Functions needed for software single-stepping.
77 */
78
79/* No delay slots on Alpha. */
80#define	next_instr_address(v, b) ((db_addr_t) ((b) ? (v) : ((v) + 4)))
81
82u_long	db_register_value(db_regs_t *, int);
83int	kdb_trap(int vector, struct trapframe *regs);
84
85u_int64_t *db_rse_current_frame(void);
86u_int64_t *db_rse_previous_frame(u_int64_t *bsp, int sof);
87u_int64_t *db_rse_register_address(u_int64_t *bsp, int regno);
88
89/*
90 * Pretty arbitrary
91 */
92#define	DB_SMALL_VALUE_MAX	0x7fffffff
93#define	DB_SMALL_VALUE_MIN	(-0x400001)
94
95/*
96 * We define some of our own commands.
97 */
98#define	DB_MACHINE_COMMANDS
99
100/*
101 * We use Elf64 symbols in DDB.
102 */
103#define	DB_ELFSIZE	64
104
105#endif	/* _ALPHA_DB_MACHDEP_H_ */
106