db_machdep.h revision 89491
166458Sdfr/* $FreeBSD: head/sys/ia64/include/db_machdep.h 89491 2002-01-18 07:47:38Z marcel $ */ 266458Sdfr/* $NetBSD: db_machdep.h,v 1.6 1997/09/06 02:02:25 thorpej Exp $ */ 366458Sdfr 466458Sdfr/* 566458Sdfr * Copyright (c) 1995 Carnegie-Mellon University. 666458Sdfr * All rights reserved. 766458Sdfr * 866458Sdfr * Author: Chris G. Demetriou 966458Sdfr * 1066458Sdfr * Permission to use, copy, modify and distribute this software and 1166458Sdfr * its documentation is hereby granted, provided that both the copyright 1266458Sdfr * notice and this permission notice appear in all copies of the 1366458Sdfr * software, derivative works or modified versions, and any portions 1466458Sdfr * thereof, and that both notices appear in supporting documentation. 1566458Sdfr * 1666458Sdfr * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 1766458Sdfr * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 1866458Sdfr * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 1966458Sdfr * 2066458Sdfr * Carnegie Mellon requests users of this software to return to 2166458Sdfr * 2266458Sdfr * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 2366458Sdfr * School of Computer Science 2466458Sdfr * Carnegie Mellon University 2566458Sdfr * Pittsburgh PA 15213-3890 2666458Sdfr * 2766458Sdfr * any improvements or extensions that they make and grant Carnegie the 2866458Sdfr * rights to redistribute these changes. 2966458Sdfr */ 3066458Sdfr 3166458Sdfr#ifndef _ALPHA_DB_MACHDEP_H_ 3266458Sdfr#define _ALPHA_DB_MACHDEP_H_ 3366458Sdfr 3466458Sdfr/* 3566458Sdfr * Machine-dependent defines for new kernel debugger. 3666458Sdfr */ 3766458Sdfr 3866458Sdfr#include <sys/param.h> 3966458Sdfr#include <vm/vm.h> 4066458Sdfr#include <machine/frame.h> 4166458Sdfr 4266458Sdfr#define DB_NO_AOUT 4366458Sdfr 4485109Sdfrstruct ia64_bundle; 4583506Sdfr 4666458Sdfrtypedef vm_offset_t db_addr_t; /* address - unsigned */ 4766458Sdfrtypedef long db_expr_t; /* expression - signed */ 4866458Sdfrtypedef struct trapframe db_regs_t; 4989491Smarcelextern db_regs_t ddb_regs; /* register state */ 5066458Sdfr#define DDB_REGS (&ddb_regs) 5166458Sdfr 5266937Sdfr#define PC_REGS(regs) ((db_addr_t)(regs)->tf_cr_iip \ 5366937Sdfr + (((regs)->tf_cr_ipsr >> 41) & 3)) 5466458Sdfr 5583506Sdfr#define BKPT_WRITE(addr, storage) db_write_breakpoint(addr, storage) 5683506Sdfr#define BKPT_CLEAR(addr, storage) db_clear_breakpoint(addr, storage) 5783506Sdfr#define BKPT_INST_TYPE u_int64_t 5866458Sdfr 5983506Sdfr#define BKPT_SKIP db_skip_breakpoint() 6066458Sdfr 6183506Sdfr#define db_clear_single_step(regs) ddb_regs.tf_cr_ipsr &= ~IA64_PSR_SS 6283506Sdfr#define db_set_single_step(regs) ddb_regs.tf_cr_ipsr |= IA64_PSR_SS 6366937Sdfr 6483506Sdfr#define IS_BREAKPOINT_TRAP(type, code) (type == IA64_VEC_BREAK) 6566458Sdfr#define IS_WATCHPOINT_TRAP(type, code) 0 6666458Sdfr 6766937Sdfr#define inst_trap_return(ins) 0 6866937Sdfr#define inst_return(ins) 0 6966937Sdfr#define inst_call(ins) 0 7066937Sdfr#define inst_branch(ins) 0 7166937Sdfr#define inst_load(ins) 0 7266937Sdfr#define inst_store(ins) 0 7366937Sdfr#define inst_unconditional_flow_transfer(ins) 0 7466937Sdfr 7566937Sdfr#define branch_taken(ins, pc, regs) pc 7666937Sdfr 7766458Sdfr/* 7866458Sdfr * Functions needed for software single-stepping. 7966458Sdfr */ 8066458Sdfr 8166458Sdfr/* No delay slots on Alpha. */ 8266458Sdfr#define next_instr_address(v, b) ((db_addr_t) ((b) ? (v) : ((v) + 4))) 8366458Sdfr 8466937Sdfru_long db_register_value(db_regs_t *, int); 8566937Sdfrint kdb_trap(int vector, struct trapframe *regs); 8666458Sdfr 8775666Sdfru_int64_t *db_rse_current_frame(void); 8875666Sdfru_int64_t *db_rse_previous_frame(u_int64_t *bsp, int sof); 8975666Sdfru_int64_t *db_rse_register_address(u_int64_t *bsp, int regno); 9075666Sdfr 9183506Sdfrvoid db_read_bundle(db_addr_t addr, struct ia64_bundle *bp); 9283506Sdfrvoid db_write_bundle(db_addr_t addr, struct ia64_bundle *bp); 9383506Sdfrvoid db_write_breakpoint(db_addr_t addr, u_int64_t *storage); 9483506Sdfrvoid db_clear_breakpoint(db_addr_t addr, u_int64_t *storage); 9583506Sdfrvoid db_skip_breakpoint(void); 9683506Sdfr 9766458Sdfr/* 9866458Sdfr * Pretty arbitrary 9966458Sdfr */ 10066458Sdfr#define DB_SMALL_VALUE_MAX 0x7fffffff 10166458Sdfr#define DB_SMALL_VALUE_MIN (-0x400001) 10266458Sdfr 10366458Sdfr/* 10466458Sdfr * We define some of our own commands. 10566458Sdfr */ 10666458Sdfr#define DB_MACHINE_COMMANDS 10766458Sdfr 10866458Sdfr/* 10966458Sdfr * We use Elf64 symbols in DDB. 11066458Sdfr */ 11166458Sdfr#define DB_ELFSIZE 64 11266458Sdfr 11366458Sdfr#endif /* _ALPHA_DB_MACHDEP_H_ */ 114