db_machdep.h revision 129198
1129198Scognet/*
2129198Scognet * Mach Operating System
3129198Scognet * Copyright (c) 1991,1990 Carnegie Mellon University
4129198Scognet * All Rights Reserved.
5129198Scognet *
6129198Scognet * Permission to use, copy, modify and distribute this software and its
7129198Scognet * documentation is hereby granted, provided that both the copyright
8129198Scognet * notice and this permission notice appear in all copies of the
9129198Scognet * software, derivative works or modified versions, and any portions
10129198Scognet * thereof, and that both notices appear in supporting documentation.
11129198Scognet *
12129198Scognet * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13129198Scognet * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14129198Scognet * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15129198Scognet *
16129198Scognet * Carnegie Mellon requests users of this software to return to
17129198Scognet *
18129198Scognet *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
19129198Scognet *  School of Computer Science
20129198Scognet *  Carnegie Mellon University
21129198Scognet *  Pittsburgh PA 15213-3890
22129198Scognet *
23129198Scognet * any improvements or extensions that they make and grant Carnegie Mellon
24129198Scognet * the rights to redistribute these changes.
25129198Scognet *
26129198Scognet *	from: FreeBSD: src/sys/i386/include/db_machdep.h,v 1.16 1999/10/04
27129198Scognet * $FreeBSD: head/sys/arm/include/db_machdep.h 129198 2004-05-14 11:46:45Z cognet $
28129198Scognet */
29129198Scognet
30129198Scognet#ifndef	_MACHINE_DB_MACHDEP_H_
31129198Scognet#define	_MACHINE_DB_MACHDEP_H_
32129198Scognet
33129198Scognet#include <machine/frame.h>
34129198Scognet#include <machine/trap.h>
35129198Scognet#include <machine/armreg.h>
36129198Scognet
37129198Scognet#define	BYTE_MSF	(1)
38129198Scognet
39129198Scognet#define T_BREAKPOINT	(1)
40129198Scognettypedef vm_offset_t	db_addr_t;
41129198Scognettypedef int		db_expr_t;
42129198Scognet
43129198Scognettypedef struct trapframe db_regs_t;
44129198Scognetextern db_regs_t ddb_regs;
45129198Scognet#define	DDB_REGS	(&ddb_regs)
46129198Scognet
47129198Scognet#define	PC_REGS(regs)	((db_addr_t)(regs)->tf_pc)
48129198Scognet
49129198Scognet#define	BKPT_INST	(KERNEL_BREAKPOINT)
50129198Scognet#define	BKPT_SIZE	(INSN_SIZE)
51129198Scognet#define	BKPT_SET(inst)	(BKPT_INST)
52129198Scognet
53129198Scognet#define	BKPT_SKIP do {							\
54129198Scognet	ddb_regs.tf_pc -= BKPT_SIZE; \
55129198Scognet} while (0)
56129198Scognet
57129198Scognet#define	db_clear_single_step(regs)
58129198Scognet#define	db_set_single_step(regs)
59129198Scognet
60129198Scognet#define	IS_BREAKPOINT_TRAP(type, code)	(type == T_BREAKPOINT)
61129198Scognet#define	IS_WATCHPOINT_TRAP(type, code)	(0)
62129198Scognet
63129198Scognet#define	inst_trap_return(ins)	(0)
64129198Scognet#define	inst_return(ins)	(0)
65129198Scognet#define	inst_call(ins)		(0)
66129198Scognet#define	inst_load(ins)		(0)
67129198Scognet#define	inst_store(ins)		(0)
68129198Scognet
69129198Scognet#define	DB_SMALL_VALUE_MAX	(0x7fffffff)
70129198Scognet#define	DB_SMALL_VALUE_MIN	(-0x40001)
71129198Scognet
72129198Scognet#define	DB_ELFSIZE		64
73129198Scognet
74129198Scognetint db_validate_address(vm_offset_t);
75129198Scognet#endif /* !_MACHINE_DB_MACHDEP_H_ */
76