diff options
-rw-r--r-- | sys/arch/mvme88k/include/trap.h | 9 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/trap.c | 64 |
2 files changed, 33 insertions, 40 deletions
diff --git a/sys/arch/mvme88k/include/trap.h b/sys/arch/mvme88k/include/trap.h index 5cbfa8e113a..1cd82a99237 100644 --- a/sys/arch/mvme88k/include/trap.h +++ b/sys/arch/mvme88k/include/trap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.h,v 1.10 2001/08/12 12:03:02 heko Exp $ */ +/* $OpenBSD: trap.h,v 1.11 2001/08/24 22:52:20 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University @@ -74,7 +74,6 @@ #ifndef _LOCORE void panictrap(int type, struct m88100_saved_state *frame); -void test_trap2(int num, int m197); void test_trap(struct m88100_saved_state *frame); void error_fault(struct m88100_saved_state *frame); void error_reset(struct m88100_saved_state *frame); @@ -91,14 +90,14 @@ unsigned ss_next_instr_address(struct proc *p, unsigned pc, unsigned delay_slot) int cpu_singlestep(register struct proc *p); #if defined(MVME187) || defined(MVME188) -void trap(unsigned type, struct m88100_saved_state *frame); void syscall(register_t code, struct m88100_saved_state *tf); +void trap18x(unsigned type, struct m88100_saved_state *frame); #endif /* defined(MVME187) || defined(MVME188) */ - #ifdef MVME197 -void trap2(unsigned type, struct m88100_saved_state *frame); void m197_syscall(register_t code, struct m88100_saved_state *tf); +void trap197(unsigned type, struct m88100_saved_state *frame); #endif /* MVME197 */ + #endif /* _LOCORE */ #endif /* __MACHINE_TRAP_H__ */ diff --git a/sys/arch/mvme88k/mvme88k/trap.c b/sys/arch/mvme88k/mvme88k/trap.c index 3f4d6b7bf72..8886d354e78 100644 --- a/sys/arch/mvme88k/mvme88k/trap.c +++ b/sys/arch/mvme88k/mvme88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.17 2001/06/27 04:29:21 art Exp $ */ +/* $OpenBSD: trap.c,v 1.18 2001/08/24 22:52:22 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -46,61 +46,63 @@ #include <sys/types.h> #include <sys/param.h> -#include <vm/vm.h> -#include <vm/vm_kern.h> /* kernel_map */ -#include <uvm/uvm_extern.h> #include <sys/proc.h> #include <sys/signalvar.h> #include <sys/user.h> #include <sys/syscall.h> +#include <sys/systm.h> #include <sys/ktrace.h> + +#include <vm/vm.h> +#include <vm/vm_kern.h> /* kernel_map */ + +#include <uvm/uvm_extern.h> + +#include <machine/asm_macro.h> /* enable/disable interrupts */ #include <machine/bugio.h> /* bugreturn() */ #include <machine/cpu.h> /* DMT_VALID, etc. */ -#include <machine/asm_macro.h> /* enable/disable interrupts */ +#include <machine/locore.h> #include <machine/m88100.h> /* DMT_VALID, etc. */ #ifdef MVME197 #include <machine/m88110.h> /* DMT_VALID, etc. */ #endif -#include <machine/locore.h> -#include <machine/trap.h> -#include <machine/psl.h> /* FIP_E, etc. */ #include <machine/pcb.h> /* FIP_E, etc. */ +#include <machine/psl.h> /* FIP_E, etc. */ +#include <machine/trap.h> -#include <sys/systm.h> - -#if (DDB) - #include <machine/db_machdep.h> - #include <ddb/db_output.h> /* db_printf() */ +#ifdef DDB +#include <machine/db_machdep.h> +#include <ddb/db_output.h> /* db_printf() */ #else - #define PC_REGS(regs) ((regs->sxip & 2) ? regs->sxip & ~3 : \ +#define PC_REGS(regs) ((regs->sxip & 2) ? regs->sxip & ~3 : \ (regs->snip & 2 ? regs->snip & ~3 : regs->sfip & ~3)) - #define inst_return(I) (((I)&0xfffffbffU) == 0xf400c001U ? TRUE : FALSE) - #define inst_call(I) ({ unsigned i = (I); \ +#define inst_return(I) (((I)&0xfffffbffU) == 0xf400c001U ? TRUE : FALSE) +#define inst_call(I) ({ unsigned i = (I); \ ((((i) & 0xf8000000U) == 0xc8000000U || /*bsr*/ \ ((i) & 0xfffffbe0U) == 0xf400c800U) /*jsr*/ \ ? TRUE : FALSE) \ ;}) - #endif /* DDB */ #define SSBREAKPOINT (0xF000D1F8U) /* Single Step Breakpoint */ #define TRAPTRACE + #if defined(TRAPTRACE) unsigned traptrace = 0; #endif #if DDB - #define DEBUG_MSG db_printf +#define DEBUG_MSG db_printf #else - #define DEBUG_MSG printf +#define DEBUG_MSG printf #endif /* DDB */ #define USERMODE(PSR) (((struct psr*)&(PSR))->psr_mode == 0) #define SYSTEMMODE(PSR) (((struct psr*)&(PSR))->psr_mode != 0) -/* XXX MAJOR CLEANUP REQUIRED TO PORT TO BSD */ +/* sigh */ +extern int procfs_domem __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); -extern int procfs_domem(); extern void regdump __P((struct trapframe *f)); char *trap_type[] = { @@ -197,7 +199,7 @@ unsigned last_vector = 0; /*ARGSUSED*/ void -trap(unsigned type, struct m88100_saved_state *frame) +trap18x(unsigned type, struct m88100_saved_state *frame) { struct proc *p; u_quad_t sticks = 0; @@ -214,7 +216,6 @@ trap(unsigned type, struct m88100_saved_state *frame) unsigned pc = PC_REGS(frame); /* get program counter (sxip) */ extern vm_map_t kernel_map; - extern int fubail(), subail(); extern unsigned guarded_access_start; extern unsigned guarded_access_end; extern unsigned guarded_access_bad; @@ -683,10 +684,11 @@ outtahere: userret(p, frame, sticks); } #endif /* defined(MVME187) || defined(MVME188) */ -/*ARGSUSED*/ + #ifdef MVME197 +/*ARGSUSED*/ void -trap2(unsigned type, struct m88100_saved_state *frame) +trap197(unsigned type, struct m88100_saved_state *frame) { struct proc *p; u_quad_t sticks = 0; @@ -698,17 +700,14 @@ trap2(unsigned type, struct m88100_saved_state *frame) unsigned nss, fault_addr; struct vmspace *vm; union sigval sv; - int su = 0; int result; int sig = 0; unsigned pc = PC_REGS(frame); /* get program counter (sxip) */ - unsigned dsr, isr, user = 0, write = 0, data = 0; + unsigned user = 0, write = 0, data = 0; extern vm_map_t kernel_map; - extern int fubail(), subail(); extern unsigned guarded_access_start; extern unsigned guarded_access_end; - extern unsigned guarded_access_bad; uvmexp.traps++; @@ -1192,12 +1191,6 @@ trap2(unsigned type, struct m88100_saved_state *frame) userret(p, frame, sticks); } -void -test_trap2(int num, int m197) -{ - DEBUG_MSG("\n[test_trap (Good News[tm]) m197 = %d, vec = %d]\n", m197, num); - bugreturn(); -} #endif /* MVME197 */ void @@ -1811,3 +1804,4 @@ register struct proc *p; if (i < 0) return (EFAULT); return (0); } + |