diff options
author | 2003-09-08 20:44:52 +0000 | |
---|---|---|
committer | 2003-09-08 20:44:52 +0000 | |
commit | 1aa5c7dd4fee62a992974027307a098148fd1bd7 (patch) | |
tree | 13836cde91fc82d9eac818c927caeeabe866ba97 | |
parent | fix pr3455 from Joerg.Sonnenberger. slightly improved fix suggested by (diff) | |
download | wireguard-openbsd-1aa5c7dd4fee62a992974027307a098148fd1bd7.tar.xz wireguard-openbsd-1aa5c7dd4fee62a992974027307a098148fd1bd7.zip |
Revert the changes reordering the data access exception processing in the
context of a regular exception. This was probably a good move, but it
eventually causes issues when uptimes grows towards infinity...
Of course, diagnosing such an issue at the same time that the disk drive
is dying and causes problems on his own, is not exactly easy...
-rw-r--r-- | sys/arch/mvme88k/mvme88k/eh.S | 37 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 36 |
2 files changed, 43 insertions, 30 deletions
diff --git a/sys/arch/mvme88k/mvme88k/eh.S b/sys/arch/mvme88k/mvme88k/eh.S index 7e10a4c3142..a46b794729a 100644 --- a/sys/arch/mvme88k/mvme88k/eh.S +++ b/sys/arch/mvme88k/mvme88k/eh.S @@ -1,4 +1,4 @@ -/* $OpenBSD: eh.S,v 1.39 2003/09/07 01:49:16 miod Exp $ */ +/* $OpenBSD: eh.S,v 1.40 2003/09/08 20:44:52 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -1862,10 +1862,15 @@ ASLOCAL(fpu_enable) bb1.n eq, r3, 8f #endif - /* service any outstanding data pipeline stuff */ + /* enable interrupts */ + ldcr r2, PSR + clr r2, r2, 1<PSR_INTERRUPT_DISABLE_BIT> + stcr r2, PSR + FLUSH_PIPELINE - ld r3, r30, REG_OFF(EF_DMT0) - bb0 DMT_VALID_BIT, r3, 7f + /* service any outstanding data pipeline stuff */ + ld r3, r30, REG_OFF(EF_DMT0) + bb0 DMT_VALID_BIT, r3, 8f /* * r30 can be clobbered by calls. So stuff its value into a preserved @@ -1875,13 +1880,6 @@ ASLOCAL(fpu_enable) CALL(_C_LABEL(m88100_trap), T_DATAFLT, r15) or r30, r0, r15 -7: - /* enable interrupts */ - ldcr r2, PSR - clr r2, r2, 1<PSR_INTERRUPT_DISABLE_BIT> - stcr r2, PSR - FLUSH_PIPELINE - 8: jmp r14 /* loaded above */ #endif /* M88100 */ @@ -1955,6 +1953,23 @@ ASLOCAL(return_from_exception_handler) ld r3, FPTR, REG_OFF(EF_DMT0) bb0 DMT_VALID_BIT, r3, _ASM_LABEL(check_ast) + /* + * If it'not the interrupt exception, and interrupts were + * initially disabled, enable interrupts again. + */ + ld r2, FPTR, REG_OFF(EF_VECTOR) + cmp r2, r2, 1 /* is an interrupt? */ + bb1 ne, r2, 1f /* if not so, skip */ + + /* if EPSR has interrupts disabled, skip also */ + ld r2, FPTR, REG_OFF(EF_EPSR) + bb1 PSR_INTERRUPT_DISABLE_BIT, r2, 1f + ldcr r2, PSR + clr r2, r2, 1<PSR_INTERRUPT_DISABLE_BIT> + stcr r2, PSR + FLUSH_PIPELINE +1: + CALL(_C_LABEL(m88100_trap), T_DATAFLT, r30) br _ASM_LABEL(check_ast) #endif /* M88100 */ diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index ffd7dd45cd8..e4f1070ce1b 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.109 2003/09/06 15:07:43 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.110 2003/09/08 20:44:52 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -1641,14 +1641,6 @@ m188_ext_int(u_int v, struct m88100_saved_state *eframe) setipl(level); - /* - * Contrary to other traps, we have not checked for the - * data pipeline status yet. - * Do it now, before we reenable interrupts. - */ - if (eframe->dmt0 & DMT_VALID) - m88100_trap(T_DATAFLT, eframe); - enable_interrupt(); /* generate IACK and get the vector */ @@ -1737,10 +1729,17 @@ m188_ext_int(u_int v, struct m88100_saved_state *eframe) } while ((cur_mask = ISR_GET_CURRENT_MASK(cpu)) != 0); /* + * process any remaining data access exceptions before + * returning to assembler + */ + disable_interrupt(); + if (eframe->dmt0 & DMT_VALID) + m88100_trap(T_DATAFLT, eframe); + + /* * Restore the mask level to what it was when the interrupt * was taken. */ - disable_interrupt(); setipl(eframe->mask); flush_pipeline(); } @@ -1805,14 +1804,6 @@ m187_ext_int(u_int v, struct m88100_saved_state *eframe) flush_pipeline(); flush_pipeline(); - /* - * Contrary to other traps, we have not checked for the - * data pipeline status yet. - * Do it now, before we reenable interrupts. - */ - if (eframe->dmt0 & DMT_VALID) - m88100_trap(T_DATAFLT, eframe); - enable_interrupt(); if ((intr = intr_handlers[vec]) == NULL) { @@ -1852,10 +1843,17 @@ m187_ext_int(u_int v, struct m88100_saved_state *eframe) } /* + * process any remaining data access exceptions before + * returning to assembler + */ + disable_interrupt(); + if (eframe->dmt0 & DMT_VALID) + m88100_trap(T_DATAFLT, eframe); + + /* * Restore the mask level to what it was when the interrupt * was taken. */ - disable_interrupt(); setipl(eframe->mask); } #endif /* MVME187 */ |