diff options
Diffstat (limited to 'sys/arch/mvme88k/include/db_machdep.h')
-rw-r--r-- | sys/arch/mvme88k/include/db_machdep.h | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/sys/arch/mvme88k/include/db_machdep.h b/sys/arch/mvme88k/include/db_machdep.h index 0cc38b7a625..286f136553a 100644 --- a/sys/arch/mvme88k/include/db_machdep.h +++ b/sys/arch/mvme88k/include/db_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_machdep.h,v 1.18 2001/12/16 23:49:46 miod Exp $ */ +/* $OpenBSD: db_machdep.h,v 1.19 2001/12/22 08:31:05 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -49,8 +49,15 @@ #include <uvm/uvm_param.h> -#define BKPT_SIZE (4) /* number of bytes in bkpt inst. */ -#define BKPT_INST (0xF000D000 | DDB_ENTRY_BKPT_NO) /* tb0, 0,r0, vector 130 */ +/* + * This is a hack so that mc88100 can use software single step + * and mc88110 can use the wonderful hardware single step + * feature. XXX smurph + */ +#define INTERNAL_SSTEP /* Use local Single Step routines */ + +#define BKPT_SIZE (4) /* number of bytes in bkpt inst. */ +#define BKPT_INST (0xF000D000 | DDB_ENTRY_BKPT_NO) /* tb0, 0,r0, vector 130 */ #define BKPT_SET(inst) (BKPT_INST) /* Entry trap for the debugger - used for inline assembly breaks*/ @@ -71,7 +78,9 @@ extern db_regs_t ddb_regs; /* register state */ ({ \ int ret; \ \ - if (regs->sxip & 2) /* is valid */ \ + if (cputyp == CPU_88110) \ + ret = regs->exip & ~3; \ + else if (regs->sxip & 2) /* is valid */ \ ret = regs->sxip & ~3; \ else if (regs->snip & 2) \ ret = regs->snip & ~3; \ @@ -85,12 +94,15 @@ extern db_regs_t ddb_regs; /* register state */ * This is an actual function due to the fact that the sxip * or snip could be nooped out due to a jmp or rte */ -#define PC_REGS(regs) ((regs->sxip & 2) ? regs->sxip & ~3 : \ +#define PC_REGS(regs) cputyp == CPU_88110 ? (regs->exip & ~3) :\ + ((regs->sxip & 2) ? regs->sxip & ~3 : \ (regs->snip & 2 ? regs->snip & ~3 : regs->sfip & ~3)) -#define l_PC_REGS(regs) ((regs->sxip & 2) ? regs->sxip : \ +#define l_PC_REGS(regs) cputyp == CPU_88110 ? (regs->exip & ~3) :\ + ((regs->sxip & 2) ? regs->sxip : \ (regs->snip & 2 ? regs->snip : regs->sfip )) -#define pC_REGS(regs) (regs->sxip & 2) ? regs->sxip : (regs->snip & 2 ? \ +#define pC_REGS(regs) cputyp == CPU_88110 ? (regs->exip & ~3) :\ + (regs->sxip & 2) ? regs->sxip : (regs->snip & 2 ? \ regs->snip : regs->sfip) extern int db_noisy; #define NOISY(x) if (db_noisy) x @@ -109,7 +121,8 @@ unsigned inst_store __P((unsigned)); boolean_t inst_branch __P((unsigned)); db_addr_t next_instr_address __P((db_addr_t, unsigned)); db_addr_t branch_taken __P((u_int, db_addr_t, - db_expr_t (*) __P((db_regs_t *, int)), db_regs_t *)); + db_expr_t (*) __P((db_regs_t *, int)), + db_regs_t *)); int ddb_break_trap __P((int type, db_regs_t *eframe)); int ddb_entry_trap __P((int level, db_regs_t *eframe)); @@ -124,8 +137,14 @@ int ddb_entry_trap __P((int level, db_regs_t *eframe)); /* we don't want coff support */ #define DB_NO_COFF 1 +#ifdef INTERNAL_SSTEP +extern register_t getreg_val __P((db_regs_t *, int)); +void db_set_single_step __P((register db_regs_t *)); +void db_clear_single_step __P((register db_regs_t *)); +#else /* need software single step */ -#define SOFTWARE_SSTEP 1 /* we need this XXX nivas */ +#define SOFTWARE_SSTEP 1 /* we need this for mc88100 */ +#endif /* * Debugger can get to any address space |