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.
This commit is contained in:
mycroft 1999-05-05 22:06:15 +00:00
parent f836f11767
commit e6548e54bd
1 changed files with 10 additions and 6 deletions

View File

@ -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.
@ -149,6 +149,15 @@ data_abort_handler(frame)
u_quad_t sticks = 0;
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 @@ data_abort_handler(frame)
/* 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;