/*-1* Mach Operating System2* Copyright (c) 1991,1990 Carnegie Mellon University3* All Rights Reserved.4*5* Permission to use, copy, modify and distribute this software and its6* documentation is hereby granted, provided that both the copyright7* notice and this permission notice appear in all copies of the8* software, derivative works or modified versions, and any portions9* thereof, and that both notices appear in supporting documentation.10*11* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"12* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR13* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.14*15* Carnegie Mellon requests users of this software to return to16*17* Software Distribution Coordinator or [email protected]18* School of Computer Science19* Carnegie Mellon University20* Pittsburgh PA 15213-389021*22* any improvements or extensions that they make and grant Carnegie Mellon23* the rights to redistribute these changes.24*25* from: FreeBSD: src/sys/i386/include/db_machdep.h,v 1.16 1999/10/0426*/2728#ifndef _MACHINE_DB_MACHDEP_H_29#define _MACHINE_DB_MACHDEP_H_3031#include <machine/frame.h>32#include <machine/trap.h>33#include <machine/armreg.h>3435#define T_BREAKPOINT (1)36#define T_WATCHPOINT (2)37typedef vm_offset_t db_addr_t;38typedef int db_expr_t;3940#define PC_REGS() ((db_addr_t)kdb_thrctx->pcb_regs.sf_pc)4142#define BKPT_INST (KERNEL_BREAKPOINT)43#define BKPT_SIZE (INSN_SIZE)44#define BKPT_SET(inst) (BKPT_INST)4546#define BKPT_SKIP do { \47kdb_frame->tf_pc += BKPT_SIZE; \48} while (0)4950#define db_clear_single_step kdb_cpu_clear_singlestep51#define db_set_single_step kdb_cpu_set_singlestep52#define db_pc_is_singlestep kdb_cpu_pc_is_singlestep5354#define IS_BREAKPOINT_TRAP(type, code) (type == T_BREAKPOINT)55#define IS_WATCHPOINT_TRAP(type, code) (type == T_WATCHPOINT)5657#define inst_trap_return(ins) (0)58/* ldmxx reg, {..., pc}5901800000 stack mode60000f0000 register610000ffff register list */62/* mov pc, reg630000000f register */64#define inst_return(ins) (((ins) & 0x0e108000) == 0x08108000 || \65((ins) & 0x0ff0fff0) == 0x01a0f000 || \66((ins) & 0x0ffffff0) == 0x012fff10) /* bx */67/* bl ...6800ffffff offset>>2 */69#define inst_call(ins) (((ins) & 0x0f000000) == 0x0b000000)70/* b ...7100ffffff offset>>2 */72/* ldr pc, [pc, reg, lsl #2]730000000f register */7475#define inst_branch(ins) (((ins) & 0x0f000000) == 0x0a000000 || \76((ins) & 0x0fdffff0) == 0x079ff100 || \77((ins) & 0x0cd0f000) == 0x0490f000 || \78((ins) & 0x0ffffff0) == 0x012fff30 || /* blx */ \79((ins) & 0x0de0f000) == 0x0080f000)8081#define inst_load(ins) (0)82#define inst_store(ins) (0)8384#define next_instr_address(pc, bd) ((bd) ? (pc) : ((pc) + INSN_SIZE))8586#define DB_ELFSIZE 328788int db_validate_address(vm_offset_t);8990u_int branch_taken (u_int insn, db_addr_t pc);9192#endif /* !_MACHINE_DB_MACHDEP_H_ */939495