summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-03-02 22:55:56 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-03-02 22:55:56 +0000
commit2cc7685dec422d77cb6285a5f9168f2fd6b6d807 (patch)
tree842ee66baa098d0b22224b66a2ce1559721327b5 /sys/arch
parent1dd626e827063b7bea762532617571b5ecacb8db (diff)
68040 boards would not set address error and bus error trap vectors correctly;
fix inspired by the hp300 code.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme68k/mvme68k/locore.s64
-rw-r--r--sys/arch/mvme68k/mvme68k/machdep.c11
-rw-r--r--sys/arch/mvme68k/mvme68k/vectors.s6
3 files changed, 24 insertions, 57 deletions
diff --git a/sys/arch/mvme68k/mvme68k/locore.s b/sys/arch/mvme68k/mvme68k/locore.s
index 7889b0e4a26..6b26d1ece58 100644
--- a/sys/arch/mvme68k/mvme68k/locore.s
+++ b/sys/arch/mvme68k/mvme68k/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.36 2003/06/02 23:27:51 millert Exp $ */
+/* $OpenBSD: locore.s,v 1.37 2004/03/02 22:55:55 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -264,6 +264,10 @@ is162:
RELOC(fputype, a0)
movl #FPU_68040,a0@ | and a 68040 FPU
+ RELOC(vectab, a1)
+ movl #_C_LABEL(buserr40),a1@(8)
+ movl #_C_LABEL(addrerr4060),a1@(12)
+
bra is16x
#endif
@@ -284,6 +288,10 @@ is167:
RELOC(fputype, a0)
movl #FPU_68040,a0@ | and a 68040 FPU
+ RELOC(vectab, a1)
+ movl #_C_LABEL(buserr40),a1@(8)
+ movl #_C_LABEL(addrerr4060),a1@(12)
+
bra is16x
#endif
@@ -308,6 +316,10 @@ is172:
RELOC(fputype, a0)
movl #FPU_68060,a0@ | and a 68060 FPU
+ RELOC(vectab, a1)
+ movl #_C_LABEL(buserr60),a1@(8)
+ movl #_C_LABEL(addrerr4060),a1@(12)
+
bra is16x
#endif
@@ -334,6 +346,10 @@ is177:
RELOC(fputype, a0)
movl #FPU_68060,a0@ | and a 68060 FPU
+ RELOC(vectab, a1)
+ movl #_C_LABEL(buserr60),a1@(8)
+ movl #_C_LABEL(addrerr4060),a1@(12)
+
bra is16x
#endif
@@ -711,57 +727,13 @@ Lbe1stpg:
jra _ASM_LABEL(faultstkadj) | and deal with it
#endif
-_C_LABEL(buserr):
- tstl _C_LABEL(nofault) | device probe?
- jeq Lberr | no, handle as usual
- movl _C_LABEL(nofault),sp@- | yes,
- jbsr _C_LABEL(longjmp) | longjmp(nofault)
- /* NOTREACHED */
-Lberr:
-#if defined(M68040) || defined(M68060)
- cmpl #MMU_68040,_C_LABEL(mmutype) | 68040?
- jgt _C_LABEL(addrerr) | no, skip
+ENTRY_NOPROFILE(busaddrerr2030)
clrl sp@- | stack adjust count
moveml #0xFFFF,sp@- | save user registers
movl usp,a0 | save the user SP
movl a0,sp@(FR_SP) | in the savearea
lea sp@(FR_HW),a1 | grab base of HW berr frame
moveq #0,d0
- movw a1@(12),d0 | grab SSW
- movl a1@(20),d1 | and fault VA
- btst #11,d0 | check for mis-aligned access
- jeq Lberr2 | no, skip
- addl #3,d1 | yes, get into next page
- andl #PG_FRAME,d1 | and truncate
-Lberr2:
- movl d1,sp@- | push fault VA
- movl d0,sp@- | and padded SSW
- btst #10,d0 | ATC bit set?
- jeq Lisberr | no, must be a real bus error
- movc dfc,d1 | yes, get MMU fault
- movc d0,dfc | store faulting function code
- movl sp@(4),a0 | get faulting address
- .word 0xf568 | ptestr a0@
- movc d1,dfc
- .long 0x4e7a0805 | movc mmusr,d0
- movw d0,sp@ | save (ONLY LOW 16 BITS!)
- jra Lismerr
-#endif
-_C_LABEL(addrerr):
- clrl sp@- | stack adjust count
- moveml #0xFFFF,sp@- | save user registers
- movl usp,a0 | save the user SP
- movl a0,sp@(FR_SP) | in the savearea
- lea sp@(FR_HW),a1 | grab base of HW berr frame
-#if defined(M68040) || defined(M68060)
- cmpl #MMU_68040,_C_LABEL(mmutype) | 68040?
- jgt Lbenot040 | no, skip
- movl a1@(8),sp@- | yes, push fault address
- clrl sp@- | no SSW for address fault
- jra Lisaerr | go deal with it
-Lbenot040:
-#endif
- moveq #0,d0
movw a1@(10),d0 | grab SSW for fault processing
btst #12,d0 | RB set?
jeq LbeX0 | no, test RC
diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c
index 12086f6700b..37878ce5651 100644
--- a/sys/arch/mvme68k/mvme68k/machdep.c
+++ b/sys/arch/mvme68k/mvme68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.81 2004/02/19 18:46:18 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.82 2004/03/02 22:55:55 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -542,12 +542,11 @@ identifycpu()
case MMU_68040:
#ifdef FPSP
bcopy(&fpsp_tab, &fpvect_tab,
- (&fpvect_end - &fpvect_tab) * sizeof (fpvect_tab));
+ (&fpvect_end - &fpvect_tab) * sizeof (fpvect_tab));
#endif
/* FALLTHROUGH */
case MMU_68060:
- strlcat(cpu_model, "+MMU", sizeof cpu_model);
- break;
+ /* FALLTHROUGH */
#endif
case MMU_68030:
strlcat(cpu_model, "+MMU", sizeof cpu_model);
@@ -940,11 +939,7 @@ initvectors()
asm volatile ("movl %0,d0; .word 0x4e7b,0x0808" : :
"d"(m68060_pcr_init):"d0" );
- /* bus/addrerr vectors */
- vectab[2] = buserr60;
- vectab[3] = addrerr4060;
#if defined(M060SP)
-
/* integer support */
vectab[61] = intemu60/*(trapfun *)&I_CALL_TOP[128 + 0x00]*/;
diff --git a/sys/arch/mvme68k/mvme68k/vectors.s b/sys/arch/mvme68k/mvme68k/vectors.s
index 3018f8e617e..b5828d4abb7 100644
--- a/sys/arch/mvme68k/mvme68k/vectors.s
+++ b/sys/arch/mvme68k/mvme68k/vectors.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: vectors.s,v 1.9 2004/01/27 16:16:27 miod Exp $ */
+/* $OpenBSD: vectors.s,v 1.10 2004/03/02 22:55:55 miod Exp $ */
| Copyright (c) 1995 Theo de Raadt
|
@@ -72,8 +72,8 @@
GLOBAL(vectab)
.long 0x12345678 /* 0: jmp 0x7400:w (unused reset SSP) */
VECTOR_UNUSED /* 1: NOT USED (reset PC) */
- VECTOR(buserr) /* 2: bus error */
- VECTOR(addrerr) /* 3: address error */
+ VECTOR(busaddrerr2030) /* 2: bus error */
+ VECTOR(busaddrerr2030) /* 3: address error */
VECTOR(illinst) /* 4: illegal instruction */
VECTOR(zerodiv) /* 5: zero divide */
VECTOR(chkinst) /* 6: CHK instruction */