summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/arch/m88k/m88k/subr.S37
-rw-r--r--sys/arch/m88k/m88k/trap.c21
-rw-r--r--sys/arch/mvme88k/mvme88k/locore.S49
3 files changed, 54 insertions, 53 deletions
diff --git a/sys/arch/m88k/m88k/subr.S b/sys/arch/m88k/m88k/subr.S
index 8ba9a80aee1..aba8f783ac5 100644
--- a/sys/arch/m88k/m88k/subr.S
+++ b/sys/arch/m88k/m88k/subr.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr.S,v 1.4 2004/08/02 10:44:51 miod Exp $ */
+/* $OpenBSD: subr.S,v 1.5 2004/10/01 20:20:34 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -1540,41 +1540,6 @@ ENTRY(read_processor_identification_register)
jmp.n r1
ldcr r2, PID
-GLOBAL(guarded_access_start)
-ENTRY(guarded_access)
- cmp r9,r3,4
- bb1 eq,r9,@L145
- cmp r9,r3,2
- bb1 eq,r9,@L144
- cmp r9,r3,1
- bb1 eq,r9,@L143
- br _C_LABEL(guarded_access_bad)
-@L143:
- ld.b r9,r0,r2
- tb1 0, r0, 0
- st.b r9,r0,r4
- br @L142
-@L144:
- ld.h r9,r0,r2
- tb1 0, r0, 0
- st.h r9,r0,r4
- br @L142
-@L145:
- ld r9,r0,r2
- tb1 0, r0, 0
- st r9,r0,r4
- br @L142
-
-GLOBAL(guarded_access_bad)
- jmp.n r1
- or r2,r0,EFAULT
-
-@L142:
- jmp.n r1
- or r2,r0,0
-
-GLOBAL(guarded_access_end)
-
/*
* void set_cpu_number(unsigned number);
*
diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c
index ecc4ac6889b..271b9131d74 100644
--- a/sys/arch/m88k/m88k/trap.c
+++ b/sys/arch/m88k/m88k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.11 2004/09/30 21:48:56 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.12 2004/10/01 20:20:34 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -213,9 +213,11 @@ m88100_trap(unsigned type, struct trapframe *frame)
int sig = 0;
extern struct vm_map *kernel_map;
+#ifdef MVME188 /* XXX - only MVME188 needs guarded_access() */
extern caddr_t guarded_access_start;
extern caddr_t guarded_access_end;
extern caddr_t guarded_access_bad;
+#endif
uvmexp.traps++;
if ((p = curproc) == NULL)
@@ -317,6 +319,7 @@ m88100_trap(unsigned type, struct trapframe *frame)
#endif
switch (pbus_type) {
+#ifdef MVME188 /* XXX - only MVME188 needs guarded_access() */
case CMMU_PFSR_BERROR:
/*
* If it is a guarded access, bus error is OK.
@@ -344,6 +347,7 @@ m88100_trap(unsigned type, struct trapframe *frame)
return;
}
break;
+#endif
case CMMU_PFSR_SUCCESS:
/*
* The fault was resolved. Call data_access_emulation
@@ -651,9 +655,6 @@ m88110_trap(unsigned type, struct trapframe *frame)
pt_entry_t *pte;
extern struct vm_map *kernel_map;
- extern unsigned guarded_access_start;
- extern unsigned guarded_access_end;
- extern unsigned guarded_access_bad;
extern pt_entry_t *pmap_pte(pmap_t, vaddr_t);
uvmexp.traps++;
@@ -793,18 +794,6 @@ m88110_trap(unsigned type, struct trapframe *frame)
vm = p->p_vmspace;
map = kernel_map;
- if (frame->tf_dsr & CMMU_DSR_BE) {
- /*
- * If it is a guarded access, bus error is OK.
- */
- if ((frame->tf_exip & XIP_ADDR) >=
- (unsigned)&guarded_access_start &&
- (frame->tf_exip & XIP_ADDR) <=
- (unsigned)&guarded_access_end) {
- frame->tf_exip = (unsigned)&guarded_access_bad;
- return;
- }
- }
if (frame->tf_dsr & (CMMU_DSR_SI | CMMU_DSR_PI)) {
frame->tf_dsr &= ~CMMU_DSR_WE; /* undefined */
/*
diff --git a/sys/arch/mvme88k/mvme88k/locore.S b/sys/arch/mvme88k/mvme88k/locore.S
index 62c3b7468a5..b5adde0677a 100644
--- a/sys/arch/mvme88k/mvme88k/locore.S
+++ b/sys/arch/mvme88k/mvme88k/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.38 2004/08/25 08:00:08 miod Exp $ */
+/* $OpenBSD: locore.S,v 1.39 2004/10/01 20:20:36 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -60,6 +60,8 @@
#include "assym.h"
#include "ksyms.h"
+#include <sys/errno.h>
+
#include <machine/asm.h>
#include <machine/trap.h>
#include <machine/m88100.h>
@@ -406,7 +408,12 @@ GLOBAL(spin_cpu)
tb0 0, r0, 0x200-16 /* call 188Bug */
jmp r1
+/*
+ * MVME188 specific support routines
+ */
+
#ifdef MVME188
+
/*
* void m188_delay(int us)
*
@@ -432,6 +439,46 @@ GLOBAL(m188_delay)
subu r4, r4, 2 /* two cycles per iteration */
jmp r1
+
+/*
+ * int guarded_access(volatile u_int8_t *, unsigned, u_int8_t *)
+ *
+ * Necessary for interrupt vector retrieval - it could cause a bus error!
+ */
+GLOBAL(guarded_access_start)
+ENTRY(guarded_access)
+ cmp r9,r3,4
+ bb1 eq,r9,@L145
+ cmp r9,r3,2
+ bb1 eq,r9,@L144
+ cmp r9,r3,1
+ bb1 eq,r9,@L143
+ br _C_LABEL(guarded_access_bad)
+@L143:
+ ld.b r9,r0,r2
+ tb1 0, r0, 0
+ st.b r9,r0,r4
+ br @L142
+@L144:
+ ld.h r9,r0,r2
+ tb1 0, r0, 0
+ st.h r9,r0,r4
+ br @L142
+@L145:
+ ld r9,r0,r2
+ tb1 0, r0, 0
+ st r9,r0,r4
+ br @L142
+
+GLOBAL(guarded_access_bad)
+ jmp.n r1
+ or r2,r0,EFAULT
+
+@L142:
+ jmp.n r1
+ or r2,r0,0
+GLOBAL(guarded_access_end)
+
#endif
/*****************************************************************************/