From e6548e54bd310f2aab2c78ceaaa3451ff1a5ff44 Mon Sep 17 00:00:00 2001 From: mycroft Date: Wed, 5 May 1999 22:06:15 +0000 Subject: [PATCH] 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. --- sys/arch/arm32/arm32/fault.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/arch/arm32/arm32/fault.c b/sys/arch/arm32/arm32/fault.c index bf57cea7c974..afe467fa8f15 100644 --- a/sys/arch/arm32/arm32/fault.c +++ b/sys/arch/arm32/arm32/fault.c @@ -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;