NetBSD/sys/arch/m68k/include/db_machdep.h

105 lines
3.0 KiB
C
Raw Normal View History

/* $NetBSD: db_machdep.h,v 1.19 1997/02/18 22:29:58 gwr Exp $ */
1994-10-26 10:48:18 +03:00
1993-08-08 16:18:27 +04:00
/*
* Mach Operating System
* Copyright (c) 1992 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
* Machine-dependent defines for new kernel debugger.
*/
1994-01-09 19:26:51 +03:00
#ifndef _M68K_DB_MACHDEP_H_
#define _M68K_DB_MACHDEP_H_
1993-08-08 16:18:27 +04:00
#include <sys/types.h>
/*
* XXX - Would rather not pull in vm headers, but need boolean_t,
* at least until boolean_t moves to <sys/types.h> or someplace.
*/
1993-08-08 16:18:27 +04:00
#include <vm/vm_param.h>
#include <machine/frame.h>
1993-08-08 16:18:27 +04:00
#include <machine/psl.h>
#include <machine/trap.h>
typedef vm_offset_t db_addr_t; /* address - unsigned */
1997-02-05 08:10:24 +03:00
typedef long db_expr_t; /* expression - signed */
typedef struct trapframe db_regs_t;
extern db_regs_t ddb_regs; /* register state */
1993-08-08 16:18:27 +04:00
#define DDB_REGS (&ddb_regs)
#define PC_REGS(regs) ((db_addr_t)(regs)->tf_pc)
1993-08-08 16:18:27 +04:00
#define BKPT_INST 0x4e4f /* breakpoint instruction */
#define BKPT_SIZE (2) /* size of breakpoint inst */
#define BKPT_SET(inst) (BKPT_INST)
#define FIXUP_PC_AFTER_BREAK(regs) ((regs)->tf_pc -= BKPT_SIZE)
1993-08-08 16:18:27 +04:00
#define db_clear_single_step(regs) ((regs)->tf_sr &= ~PSL_T)
#define db_set_single_step(regs) ((regs)->tf_sr |= PSL_T)
1993-08-08 16:18:27 +04:00
#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAKPOINT)
#ifdef T_WATCHPOINT
1993-08-08 16:18:27 +04:00
#define IS_WATCHPOINT_TRAP(type, code) ((type) == T_WATCHPOINT)
#else
#define IS_WATCHPOINT_TRAP(type, code) 0
#endif
1993-08-08 16:18:27 +04:00
#define M_RTS 0xffff0000
#define I_RTS 0x4e750000
#define M_JSR 0xffc00000
#define I_JSR 0x4e800000
#define M_BSR 0xff000000
#define I_BSR 0x61000000
#define M_RTE 0xffff0000
#define I_RTE 0x4e730000
#define inst_trap_return(ins) (((ins)&M_RTE) == I_RTE)
#define inst_return(ins) (((ins)&M_RTS) == I_RTS)
#define inst_call(ins) (((ins)&M_JSR) == I_JSR || \
((ins)&M_BSR) == I_BSR)
#define inst_load(ins) 0
#define inst_store(ins) 0
/*
* Things needed by kgdb:
*/
typedef long kgdb_reg_t;
#define KGDB_NUMREGS (16+2)
#define KGDB_BUFLEN 512
1996-04-30 00:50:08 +04:00
#ifdef _KERNEL
void Debugger __P((void)); /* XXX */
void kdb_kintr __P((db_regs_t *));
int kdb_trap __P((int, db_regs_t *));
1996-04-30 00:50:08 +04:00
#endif /* _KERNEL */
1994-01-10 05:22:11 +03:00
#endif /* _M68K_DB_MACHDEP_H_ */