db_machdep.h revision 139825
1158115Sume/*-
2158115Sume * Mach Operating System
3158115Sume * Copyright (c) 1991,1990 Carnegie Mellon University
4158115Sume * All Rights Reserved.
5158115Sume *
6158115Sume * Permission to use, copy, modify and distribute this software and its
7158115Sume * documentation is hereby granted, provided that both the copyright
8158115Sume * notice and this permission notice appear in all copies of the
9158115Sume * software, derivative works or modified versions, and any portions
10158115Sume * thereof, and that both notices appear in supporting documentation.
11158115Sume *
12158115Sume * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13158115Sume * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14158115Sume * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15158115Sume *
16158115Sume * Carnegie Mellon requests users of this software to return to
17158115Sume *
18158115Sume *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
19158115Sume *  School of Computer Science
20158115Sume *  Carnegie Mellon University
21158115Sume *  Pittsburgh PA 15213-3890
22158115Sume *
23158115Sume * any improvements or extensions that they make and grant Carnegie Mellon
24158115Sume * the rights to redistribute these changes.
25158115Sume *
26158115Sume *	from: FreeBSD: src/sys/i386/include/db_machdep.h,v 1.16 1999/10/04
27158115Sume * $FreeBSD: head/sys/sparc64/include/db_machdep.h 139825 2005-01-07 02:29:27Z imp $
28158115Sume */
29158115Sume
30158115Sume#ifndef	_MACHINE_DB_MACHDEP_H_
31158115Sume#define	_MACHINE_DB_MACHDEP_H_
32158115Sume
33158115Sume#include <machine/frame.h>
34158115Sume#include <machine/trap.h>
35158115Sume
36158115Sume#define	BYTE_MSF	(1)
37158115Sume
38158115Sumetypedef vm_offset_t	db_addr_t;
39158115Sumetypedef long		db_expr_t;
40158115Sume
41158115Sume#define	PC_REGS()	((db_addr_t)kdb_thrctx->pcb_pc)
42158115Sume
43158115Sume#define	BKPT_INST	(0x91d03001)
44158115Sume#define	BKPT_SIZE	(4)
45158115Sume#define	BKPT_SET(inst)	(BKPT_INST)
46158115Sume
47158115Sume#define	BKPT_SKIP do {							\
48158115Sume	kdb_frame->tf_tpc = kdb_frame->tf_tnpc + 4;			\
49158115Sume	kdb_frame->tf_tnpc += 8;					\
50158115Sume} while (0)
51158115Sume
52158115Sume#define	db_clear_single_step	kdb_cpu_clear_singlestep
53158115Sume#define	db_set_single_step	kdb_cpu_set_singlestep
54158115Sume
55158115Sume#define	IS_BREAKPOINT_TRAP(type, code)	(type == T_BREAKPOINT)
56158115Sume#define	IS_WATCHPOINT_TRAP(type, code)	(0)
57158115Sume
58158115Sume#define	inst_trap_return(ins)	(0)
59158115Sume#define	inst_return(ins)	(0)
60158115Sume#define	inst_call(ins)		(0)
61158115Sume#define	inst_load(ins)		(0)
62158115Sume#define	inst_store(ins)		(0)
63158115Sume
64158115Sume#define	DB_SMALL_VALUE_MAX	(0x7fffffff)
65158115Sume#define	DB_SMALL_VALUE_MIN	(-0x40001)
66158115Sume
67158115Sume#define	DB_ELFSIZE		64
68158115Sume
69158115Sume#endif /* !_MACHINE_DB_MACHDEP_H_ */
70158115Sume