db_machdep.h revision 82004
154359Sroberto/*- 254359Sroberto * Copyright (c) 2001 Jake Burkholder. 354359Sroberto * All rights reserved. 454359Sroberto * 554359Sroberto * Redistribution and use in source and binary forms, with or without 654359Sroberto * modification, are permitted provided that the following conditions 754359Sroberto * are met: 854359Sroberto * 1. Redistributions of source code must retain the above copyright 954359Sroberto * notice, this list of conditions and the following disclaimer. 1054359Sroberto * 2. Redistributions in binary form must reproduce the above copyright 1154359Sroberto * notice, this list of conditions and the following disclaimer in the 1254359Sroberto * documentation and/or other materials provided with the distribution. 1354359Sroberto * 1454359Sroberto * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1554359Sroberto * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1654359Sroberto * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1782498Sroberto * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1882498Sroberto * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1982498Sroberto * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20285612Sdelphij * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21285612Sdelphij * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22285612Sdelphij * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23285612Sdelphij * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24285612Sdelphij * SUCH DAMAGE. 25285612Sdelphij * 2654359Sroberto * $FreeBSD: head/sys/sparc64/include/db_machdep.h 82004 2001-08-20 23:35:15Z jake $ 2754359Sroberto */ 2854359Sroberto 2954359Sroberto#ifndef _MACHINE_DB_MACHDEP_H_ 3054359Sroberto#define _MACHINE_DB_MACHDEP_H_ 3154359Sroberto 3254359Sroberto#include <machine/frame.h> 3354359Sroberto#include <machine/trap.h> 3454359Sroberto 3554359Sroberto#define BYTE_MSF (1) 3654359Sroberto 3754359Srobertotypedef vm_offset_t db_addr_t; 3854359Srobertotypedef long db_expr_t; 3954359Sroberto 4054359Srobertostruct db_regs { 4154359Sroberto u_long dr_global[8]; 4254359Sroberto}; 4354359Sroberto 4454359Srobertotypedef struct trapframe db_regs_t; 4554359Srobertoextern db_regs_t ddb_regs; 4654359Sroberto#define DDB_REGS (&ddb_regs) 4754359Sroberto 4854359Sroberto#define PC_REGS(regs) ((db_addr_t)(regs)->tf_tpc) 4954359Sroberto 5054359Sroberto#define BKPT_INST (0) 5154359Sroberto#define BKPT_SIZE (4) 5254359Sroberto#define BKPT_SET(inst) (BKPT_INST) 5354359Sroberto 5454359Sroberto#define FIXUP_PC_AFTER_BREAK do { \ 5554359Sroberto ddb_regs.tf_tpc = ddb_regs.tf_tnpc; \ 5654359Sroberto ddb_regs.tf_tnpc += BKPT_SIZE; \ 5754359Sroberto} while (0); 5854359Sroberto 5954359Sroberto#define db_clear_single_step(regs) 6054359Sroberto#define db_set_single_step(regs) 6154359Sroberto 6254359Sroberto#define IS_BREAKPOINT_TRAP(type, code) (type == T_BREAKPOINT) 6354359Sroberto#define IS_WATCHPOINT_TRAP(type, code) (0) 6454359Sroberto 6554359Sroberto#define inst_trap_return(ins) (0) 6654359Sroberto#define inst_return(ins) (0) 6754359Sroberto#define inst_call(ins) (0) 6854359Sroberto#define inst_load(ins) (0) 6954359Sroberto#define inst_store(ins) (0) 7054359Sroberto 7154359Sroberto#define DB_SMALL_VALUE_MAX (0x7fffffff) 7254359Sroberto#define DB_SMALL_VALUE_MIN (-0x40001) 7354359Sroberto 7454359Sroberto#define DB_ELFSIZE 64 7554359Sroberto 7654359Sroberto#endif /* !_MACHINE_DB_MACHDEP_H_ */ 7754359Sroberto