Home | History | Annotate | Line # | Download | only in include
db_machdep.h revision 1.3
      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 /*
     28  1.1  glass  * Machine-dependent defines for new kernel debugger.
     29  1.1  glass  */
     30  1.3    cgd #ifndef	_M68K_DB_MACHDEP_H_
     31  1.3    cgd #define	_M68K_DB_MACHDEP_H_
     32  1.1  glass 
     33  1.1  glass #include <vm/queue.h>
     34  1.1  glass #include <vm/vm_prot.h>
     35  1.1  glass #include <vm/vm_param.h>
     36  1.1  glass #include <vm/vm_inherit.h>
     37  1.1  glass #include <vm/lock.h>
     38  1.1  glass #include <machine/psl.h>
     39  1.1  glass #include <machine/trap.h>
     40  1.1  glass 
     41  1.1  glass typedef	vm_offset_t	db_addr_t;	/* address - unsigned */
     42  1.1  glass typedef	int		db_expr_t;	/* expression - signed */
     43  1.1  glass struct mc68020_saved_state {
     44  1.1  glass         int             d0;             /* data registers */
     45  1.1  glass         int             d1;
     46  1.1  glass         int             d2;
     47  1.1  glass         int             d3;
     48  1.1  glass         int             d4;
     49  1.1  glass         int             d5;
     50  1.1  glass         int             d6;
     51  1.1  glass         int             d7;
     52  1.1  glass         int             a0;             /* address registers */
     53  1.1  glass         int             a1;
     54  1.1  glass         int             a2;
     55  1.1  glass         int             a3;
     56  1.1  glass         int             a4;
     57  1.1  glass         int             a5;
     58  1.1  glass         int             a6;
     59  1.1  glass         int             sp;             /* stack pointer */
     60  1.1  glass         unsigned short  sr;             /* status register */
     61  1.1  glass         unsigned int    pc;             /* program counter - UNALIGNED!!! */
     62  1.1  glass         unsigned int    stkfmt  : 4;    /* rte stack frame format */
     63  1.1  glass         unsigned int    vector  : 12;   /* vector number */
     64  1.1  glass };
     65  1.1  glass typedef struct mc68020_saved_state db_regs_t;
     66  1.1  glass db_regs_t	ddb_regs;		/* register state */
     67  1.1  glass #define DDB_REGS	(&ddb_regs)
     68  1.1  glass 
     69  1.1  glass #define	PC_REGS(regs)	((db_addr_t)(regs)->pc)
     70  1.1  glass 
     71  1.1  glass #define	BKPT_INST	0x4e4f		/* breakpoint instruction */
     72  1.1  glass #define	BKPT_SIZE	(2)		/* size of breakpoint inst */
     73  1.1  glass #define	BKPT_SET(inst)	(BKPT_INST)
     74  1.1  glass 
     75  1.1  glass #define	FIXUP_PC_AFTER_BREAK	ddb_regs.pc -= 2;
     76  1.1  glass 
     77  1.2  glass #define SR_T1 0x8000
     78  1.1  glass #define	db_clear_single_step(regs)	((regs)->sr &= ~SR_T1)
     79  1.1  glass #define	db_set_single_step(regs)	((regs)->sr |=  SR_T1)
     80  1.1  glass 
     81  1.1  glass #define	IS_BREAKPOINT_TRAP(type, code)	((type) == T_BRKPT)
     82  1.1  glass #define	IS_WATCHPOINT_TRAP(type, code)	((type) == T_WATCHPOINT)
     83  1.1  glass 
     84  1.1  glass #define	M_RTS		0xffff0000
     85  1.1  glass #define I_RTS		0x4e750000
     86  1.1  glass #define M_JSR		0xffc00000
     87  1.1  glass #define I_JSR		0x4e800000
     88  1.1  glass #define M_BSR		0xff000000
     89  1.1  glass #define I_BSR		0x61000000
     90  1.1  glass #define	M_RTE		0xffff0000
     91  1.1  glass #define	I_RTE		0x4e730000
     92  1.1  glass 
     93  1.1  glass #define	inst_trap_return(ins)	(((ins)&M_RTE) == I_RTE)
     94  1.1  glass #define	inst_return(ins)	(((ins)&M_RTS) == I_RTS)
     95  1.1  glass #define	inst_call(ins)		(((ins)&M_JSR) == I_JSR || \
     96  1.1  glass 				 ((ins)&M_BSR) == I_BSR)
     97  1.1  glass #define inst_load(ins)		0
     98  1.1  glass #define inst_store(ins)		0
     99  1.1  glass 
    100  1.3    cgd #endif	/* _M68K_DDB_MACHDEP_H_ */
    101