/*-1* Mach Operating System2* Copyright (c) 1992 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* $OpenBSD: db_machdep.h,v 1.2 1997/03/21 00:48:48 niklas Exp $26* $NetBSD: db_machdep.h,v 1.4.22.1 2000/08/05 11:10:43 wiz Exp $27*/2829/*30* Machine-dependent defines for new kernel debugger.31*/32#ifndef _POWERPC_DB_MACHDEP_H_33#define _POWERPC_DB_MACHDEP_H_3435#include <vm/vm_param.h>36#include <machine/elf.h>3738#define DB_ELF_SYMBOLS39#define DB_ELFSIZE __ELF_WORD_SIZE4041typedef vm_offset_t db_addr_t; /* address - unsigned */42typedef intptr_t db_expr_t; /* expression - signed */4344#define PC_REGS(regs) ((db_addr_t)kdb_thrctx->pcb_lr)4546#define BKPT_INST 0x7C810808 /* breakpoint instruction */4748#define BKPT_SIZE (4) /* size of breakpoint inst */49#define BKPT_SET(inst) (BKPT_INST)5051#define db_clear_single_step kdb_cpu_clear_singlestep52#define db_set_single_step kdb_cpu_set_singlestep5354#if 055#define SR_SINGLESTEP 0x40056#define db_clear_single_step(regs) ((regs)->msr &= ~SR_SINGLESTEP)57#define db_set_single_step(regs) ((regs)->msr |= SR_SINGLESTEP)58#endif5960#define T_BREAKPOINT 0xffff61#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAKPOINT)6263#define T_WATCHPOINT 0xeeee64#ifdef T_WATCHPOINT65#define IS_WATCHPOINT_TRAP(type, code) ((type) == T_WATCHPOINT)66#else67#define IS_WATCHPOINT_TRAP(type, code) 068#endif6970#define M_RTS 0xfc0007fe71#define I_RTS 0x4c00002072#define M_BC 0xfc00000073#define I_BC 0x4000000074#define M_B 0xfc00000075#define I_B 0x5000000076#define M_RFI 0xfc0007fe77#define I_RFI 0x4c0000647879#define inst_trap_return(ins) (((ins)&M_RFI) == I_RFI)80#define inst_return(ins) (((ins)&M_RTS) == I_RTS)81#define inst_call(ins) (((ins)&M_BC ) == I_BC || \82((ins)&M_B ) == I_B )83#define inst_load(ins) 084#define inst_store(ins) 08586#endif /* _POWERPC_DB_MACHDEP_H_ */878889