1139825Simp/*-
282899Sjake * Mach Operating System
382899Sjake * Copyright (c) 1991,1990 Carnegie Mellon University
482899Sjake * All Rights Reserved.
580708Sjake *
682899Sjake * Permission to use, copy, modify and distribute this software and its
782899Sjake * documentation is hereby granted, provided that both the copyright
882899Sjake * notice and this permission notice appear in all copies of the
982899Sjake * software, derivative works or modified versions, and any portions
1082899Sjake * thereof, and that both notices appear in supporting documentation.
1180708Sjake *
1282899Sjake * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
1382899Sjake * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
1482899Sjake * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
1580708Sjake *
1682899Sjake * Carnegie Mellon requests users of this software to return to
1782899Sjake *
1882899Sjake *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
1982899Sjake *  School of Computer Science
2082899Sjake *  Carnegie Mellon University
2182899Sjake *  Pittsburgh PA 15213-3890
2282899Sjake *
2382899Sjake * any improvements or extensions that they make and grant Carnegie Mellon
2482899Sjake * the rights to redistribute these changes.
2582899Sjake *
2682899Sjake *	from: FreeBSD: src/sys/i386/include/db_machdep.h,v 1.16 1999/10/04
2780708Sjake * $FreeBSD$
2880708Sjake */
2980708Sjake
3080708Sjake#ifndef	_MACHINE_DB_MACHDEP_H_
3180708Sjake#define	_MACHINE_DB_MACHDEP_H_
3280708Sjake
3380709Sjake#include <machine/frame.h>
3480709Sjake#include <machine/trap.h>
3580709Sjake
3680709Sjake#define	BYTE_MSF	(1)
3780709Sjake
3880709Sjaketypedef vm_offset_t	db_addr_t;
3982004Sjaketypedef long		db_expr_t;
4080709Sjake
41131952Smarcel#define	PC_REGS()	((db_addr_t)kdb_thrctx->pcb_pc)
4280709Sjake
43115970Sjake#define	BKPT_INST	(0x91d03001)
4480709Sjake#define	BKPT_SIZE	(4)
4580709Sjake#define	BKPT_SET(inst)	(BKPT_INST)
4680709Sjake
4786525Sjake#define	BKPT_SKIP do {							\
48131952Smarcel	kdb_frame->tf_tpc = kdb_frame->tf_tnpc + 4;			\
49131952Smarcel	kdb_frame->tf_tnpc += 8;					\
5086525Sjake} while (0)
5180709Sjake
52131952Smarcel#define	db_clear_single_step	kdb_cpu_clear_singlestep
53131952Smarcel#define	db_set_single_step	kdb_cpu_set_singlestep
5480709Sjake
5580709Sjake#define	IS_BREAKPOINT_TRAP(type, code)	(type == T_BREAKPOINT)
5680709Sjake#define	IS_WATCHPOINT_TRAP(type, code)	(0)
5780709Sjake
5880709Sjake#define	inst_trap_return(ins)	(0)
5980709Sjake#define	inst_return(ins)	(0)
6080709Sjake#define	inst_call(ins)		(0)
6180709Sjake#define	inst_load(ins)		(0)
6280709Sjake#define	inst_store(ins)		(0)
6380709Sjake
6480709Sjake#define	DB_SMALL_VALUE_MAX	(0x7fffffff)
6580709Sjake#define	DB_SMALL_VALUE_MIN	(-0x40001)
6680709Sjake
6780709Sjake#define	DB_ELFSIZE		64
6880709Sjake
6980708Sjake#endif /* !_MACHINE_DB_MACHDEP_H_ */
70