Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm32/arm32 Enable interrupts *after* reading the f...



details:   https://anonhg.NetBSD.org/src/rev/e7738e7b7b1d
branches:  trunk
changeset: 472732:e7738e7b7b1d
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed May 05 22:06:15 1999 +0000

description:
Enable interrupts *after* reading the fault address and status.  This is
necessary because some interrupt handlers may cause additional faults (e.g.
through R/M emulation) and thereby trash the previous fault state.
>From Richard Earnshaw.

diffstat:

 sys/arch/arm32/arm32/fault.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (37 lines):

diff -r 7f6dbf09e3dc -r e7738e7b7b1d sys/arch/arm32/arm32/fault.c
--- a/sys/arch/arm32/arm32/fault.c      Wed May 05 22:02:58 1999 +0000
+++ b/sys/arch/arm32/arm32/fault.c      Wed May 05 22:06:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fault.c,v 1.42 1999/04/06 06:35:03 mark Exp $  */
+/*     $NetBSD: fault.c,v 1.43 1999/05/05 22:06:15 mycroft Exp $       */
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -150,6 +150,15 @@
        int error;
 
        /*
+        * Must get fault address and status from the CPU before
+        * re-enabling interrupts.  (Interrupt handlers may take
+        * R/M emulation faults.)
+        */
+       fault_address = cpu_faultaddress();
+       fault_status = cpu_faultstatus();
+       fault_pc = frame->tf_pc;
+
+       /*
         * Enable IRQ's (disabled by CPU on abort) if trapframe
         * shows they were enabled.
         */
@@ -159,11 +168,6 @@
        /* Update vmmeter statistics */
        uvmexp.traps++;
 
-       /* Get fault address and status from the CPU */
-       fault_address = cpu_faultaddress();
-       fault_status = cpu_faultstatus();
-       fault_pc = frame->tf_pc;
-
        /* Extract the fault code from the fault status */
        fault_code = fault_status & FAULT_TYPE_MASK;
 



Home | Main Index | Thread Index | Old Index