summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-16 00:53:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-16 00:53:46 +0000
commitd9786a8a6d48519acdf1233107ea31a88fe6fec8 (patch)
tree1a3dc90af4d63f6472c24c61466dd6c7d2f03cb3
parent8db7d350e5e338e525209f599df3332181384514 (diff)
netbsd pr#2547, is@beverly.rhein.de; handle bus errors correctly
-rw-r--r--sys/arch/mvme68k/mvme68k/locore.s32
1 files changed, 26 insertions, 6 deletions
diff --git a/sys/arch/mvme68k/mvme68k/locore.s b/sys/arch/mvme68k/mvme68k/locore.s
index 1867f276493..c4eeb0bf28e 100644
--- a/sys/arch/mvme68k/mvme68k/locore.s
+++ b/sys/arch/mvme68k/mvme68k/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.8 1996/05/29 16:37:17 chuck Exp $ */
+/* $OpenBSD: locore.s,v 1.9 1996/06/16 00:53:45 deraadt Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -657,18 +657,38 @@ Lbe10:
cmpw #12,d0 | address error vector?
jeq Lisaerr | yes, go to it
movl d1,a0 | fault address
- ptestr #1,a0@,#7 | do a table search
+ movl sp@,d0 | function code from ssw
+ btst #8,d0 | data fault?
+ jne Lbe10a
+ movql #1,d0 | user program access FC
+ | (we dont seperate data/program)
+ btst #5,a1@ | supervisor mode?
+ jeq Lbe10a | if no, done
+ movql #5,d0 | else supervisor program access
+Lbe10a:
+ ptestr d0,a0@,#7 | do a table search
pmove psr,sp@ | save result
- btst #7,sp@ | bus error bit set?
- jeq Lismerr | no, must be MMU fault
- clrw sp@ | yes, re-clear pad word
- jra Lisberr | and process as normal bus error
+ movb sp@,d1
+ btst #2,d1 | invalid (incl. limit viol. and berr)?
+ jeq Lmightnotbemerr | no -> wp check
+ btst #7,d1 | is it MMU table berr?
+ jeq Lismerr | no, must be fast
+ jra Lisberr1 | real bus err needs not be fast.
+Lmightnotbemerr:
+ btst #3,d1 | write protect bit set?
+ jeq Lisberr1 | no: must be bus error
+ movl sp@,d0 | ssw into low word of d0
+ andw #0xc0,d0 | Write protect is set on page:
+ cmpw #0x40,d0 | was it read cycle?
+ jeq Lisberr1 | yes, was not WPE, must be bus err
Lismerr:
movl #T_MMUFLT,sp@- | show that we are an MMU fault
jra Ltrapnstkadj | and deal with it
Lisaerr:
movl #T_ADDRERR,sp@- | mark address error
jra Ltrapnstkadj | and deal with it
+Lisberr1:
+ clrw sp@ | re-clear pad word
Lisberr:
movl #T_BUSERR,sp@- | mark bus error
Ltrapnstkadj: