Home | History | Annotate | Line # | Download | only in include
db_machdep.h revision 1.1
      1  1.1  glass /*
      2  1.1  glass  * Mach Operating System
      3  1.1  glass  * Copyright (c) 1992 Carnegie Mellon University
      4  1.1  glass  * All Rights Reserved.
      5  1.1  glass  *
      6  1.1  glass  * Permission to use, copy, modify and distribute this software and its
      7  1.1  glass  * documentation is hereby granted, provided that both the copyright
      8  1.1  glass  * notice and this permission notice appear in all copies of the
      9  1.1  glass  * software, derivative works or modified versions, and any portions
     10  1.1  glass  * thereof, and that both notices appear in supporting documentation.
     11  1.1  glass  *
     12  1.1  glass  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     13  1.1  glass  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
     14  1.1  glass  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     15  1.1  glass  *
     16  1.1  glass  * Carnegie Mellon requests users of this software to return to
     17  1.1  glass  *
     18  1.1  glass  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     19  1.1  glass  *  School of Computer Science
     20  1.1  glass  *  Carnegie Mellon University
     21  1.1  glass  *  Pittsburgh PA 15213-3890
     22  1.1  glass  *
     23  1.1  glass  * any improvements or extensions that they make and grant Carnegie Mellon
     24  1.1  glass  * the rights to redistribute these changes.
     25  1.1  glass  */
     26  1.1  glass /*
     27  1.1  glass  * HISTORY
     28  1.1  glass  * $Log: db_machdep.h,v $
     29  1.1  glass  * Revision 1.1  1993/08/08 12:18:27  glass
     30  1.1  glass  * various changes
     31  1.1  glass  *
     32  1.1  glass  * Revision 2.5  91/07/31  18:12:56  dbg
     33  1.1  glass  * 	Changed register save area name.
     34  1.1  glass  * 	[91/07/12            dbg]
     35  1.1  glass  *
     36  1.1  glass  * Revision 2.4  91/01/08  15:52:19  rpd
     37  1.1  glass  * 	Added dummy inst_load/inst_store macros.
     38  1.1  glass  * 	[91/01/06            rpd]
     39  1.1  glass  *
     40  1.1  glass  * Revision 2.3  90/10/25  14:47:23  rwd
     41  1.1  glass  * 	Added watchpoint support.
     42  1.1  glass  * 	[90/10/16            rwd]
     43  1.1  glass  *
     44  1.1  glass  * Revision 2.2  90/08/27  22:11:31  dbg
     45  1.1  glass  * 	Created.
     46  1.1  glass  * 	[90/07/25            dbg]
     47  1.1  glass  *
     48  1.1  glass  */
     49  1.1  glass 
     50  1.1  glass /*
     51  1.1  glass  * Machine-dependent defines for new kernel debugger.
     52  1.1  glass  */
     53  1.1  glass #ifndef	_SUN3_DB_MACHDEP_H_
     54  1.1  glass #define	_SUN3_DB_MACHDEP_H_
     55  1.1  glass 
     56  1.1  glass /*#include <mach/sun3/vm_types.h>*/
     57  1.1  glass /*#include <mach/sun3/vm_param.h>*/
     58  1.1  glass /*#include <sun3/thread.h>*/		/* for thread_status */
     59  1.1  glass #include <vm/queue.h>
     60  1.1  glass #include <vm/vm_prot.h>
     61  1.1  glass #include <vm/vm_param.h>
     62  1.1  glass #include <vm/vm_inherit.h>
     63  1.1  glass #include <vm/lock.h>
     64  1.1  glass #include <machine/psl.h>
     65  1.1  glass #include <machine/trap.h>
     66  1.1  glass 
     67  1.1  glass 
     68  1.1  glass typedef	vm_offset_t	db_addr_t;	/* address - unsigned */
     69  1.1  glass typedef	int		db_expr_t;	/* expression - signed */
     70  1.1  glass struct mc68020_saved_state {
     71  1.1  glass         int             d0;             /* data registers */
     72  1.1  glass         int             d1;
     73  1.1  glass         int             d2;
     74  1.1  glass         int             d3;
     75  1.1  glass         int             d4;
     76  1.1  glass         int             d5;
     77  1.1  glass         int             d6;
     78  1.1  glass         int             d7;
     79  1.1  glass         int             a0;             /* address registers */
     80  1.1  glass         int             a1;
     81  1.1  glass         int             a2;
     82  1.1  glass         int             a3;
     83  1.1  glass         int             a4;
     84  1.1  glass         int             a5;
     85  1.1  glass         int             a6;
     86  1.1  glass         int             sp;             /* stack pointer */
     87  1.1  glass         unsigned short  sr;             /* status register */
     88  1.1  glass         unsigned int    pc;             /* program counter - UNALIGNED!!! */
     89  1.1  glass         unsigned int    stkfmt  : 4;    /* rte stack frame format */
     90  1.1  glass         unsigned int    vector  : 12;   /* vector number */
     91  1.1  glass };
     92  1.1  glass typedef struct mc68020_saved_state db_regs_t;
     93  1.1  glass db_regs_t	ddb_regs;		/* register state */
     94  1.1  glass #define DDB_REGS	(&ddb_regs)
     95  1.1  glass 
     96  1.1  glass #define	PC_REGS(regs)	((db_addr_t)(regs)->pc)
     97  1.1  glass 
     98  1.1  glass #define	BKPT_INST	0x4e4f		/* breakpoint instruction */
     99  1.1  glass #define	BKPT_SIZE	(2)		/* size of breakpoint inst */
    100  1.1  glass #define	BKPT_SET(inst)	(BKPT_INST)
    101  1.1  glass 
    102  1.1  glass #define	FIXUP_PC_AFTER_BREAK	ddb_regs.pc -= 2;
    103  1.1  glass 
    104  1.1  glass #define	db_clear_single_step(regs)	((regs)->sr &= ~SR_T1)
    105  1.1  glass #define	db_set_single_step(regs)	((regs)->sr |=  SR_T1)
    106  1.1  glass 
    107  1.1  glass #define	IS_BREAKPOINT_TRAP(type, code)	((type) == T_BRKPT)
    108  1.1  glass #define	IS_WATCHPOINT_TRAP(type, code)	((type) == T_WATCHPOINT)
    109  1.1  glass 
    110  1.1  glass #define	M_RTS		0xffff0000
    111  1.1  glass #define I_RTS		0x4e750000
    112  1.1  glass #define M_JSR		0xffc00000
    113  1.1  glass #define I_JSR		0x4e800000
    114  1.1  glass #define M_BSR		0xff000000
    115  1.1  glass #define I_BSR		0x61000000
    116  1.1  glass #define	M_RTE		0xffff0000
    117  1.1  glass #define	I_RTE		0x4e730000
    118  1.1  glass 
    119  1.1  glass #define	inst_trap_return(ins)	(((ins)&M_RTE) == I_RTE)
    120  1.1  glass #define	inst_return(ins)	(((ins)&M_RTS) == I_RTS)
    121  1.1  glass #define	inst_call(ins)		(((ins)&M_JSR) == I_JSR || \
    122  1.1  glass 				 ((ins)&M_BSR) == I_BSR)
    123  1.1  glass #define inst_load(ins)		0
    124             #define inst_store(ins)		0
    125             
    126             #endif	/* _SUN3_DDB_MACHDEP_H_ */
    127