summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-01-06 18:02:12 +0000
committerjhb <jhb@FreeBSD.org>2006-01-06 18:02:12 +0000
commit42cfa2cc9eb59ddbe448a8b539720b20fb70fad9 (patch)
tree89e8f2c595e077746d97db22f6bf3ad5cef7c2cc
parent0beb1bf77b0408ab7b2210a0f1b220e2d7ff8a6d (diff)
downloadFreeBSD-src-42cfa2cc9eb59ddbe448a8b539720b20fb70fad9.zip
FreeBSD-src-42cfa2cc9eb59ddbe448a8b539720b20fb70fad9.tar.gz
Fix various places that were testing td_critnest to see if interrupts
should remain disabled during a trap or not to check td_md.md_spinlock_count instead.
-rw-r--r--sys/amd64/amd64/trap.c6
-rw-r--r--sys/arm/arm/trap.c7
-rw-r--r--sys/i386/i386/trap.c6
3 files changed, 10 insertions, 9 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 3ed7572..acd6140 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -220,10 +220,10 @@ trap(frame)
printf("kernel trap %d with interrupts disabled\n",
type);
/*
- * We shouldn't enable interrupts while in a critical
- * section or servicing an NMI.
+ * We shouldn't enable interrupts while holding a
+ * spin lock or servicing an NMI.
*/
- if (type != T_NMI && td->td_critnest == 0)
+ if (type != T_NMI && td->td_md.md_spinlock_count == 0)
enable_intr();
}
}
diff --git a/sys/arm/arm/trap.c b/sys/arm/arm/trap.c
index f858af0..d8620c3 100644
--- a/sys/arm/arm/trap.c
+++ b/sys/arm/arm/trap.c
@@ -269,7 +269,8 @@ data_abort_handler(trapframe_t *tf)
/* Grab the current pcb */
pcb = td->td_pcb;
/* Re-enable interrupts if they were enabled previously */
- if (td->td_critnest == 0 && __predict_true(tf->tf_spsr & I32_bit) == 0)
+ if (td->td_md.md_spinlock_count == 0 &&
+ __predict_true(tf->tf_spsr & I32_bit) == 0)
enable_interrupts(I32_bit);
/* Invoke the appropriate handler, if necessary */
@@ -729,7 +730,7 @@ prefetch_abort_handler(trapframe_t *tf)
thread_user_enter(td);
}
fault_pc = tf->tf_pc;
- if (td->td_critnest == 0 &&
+ if (td->td_md.md_spinlock_count == 0 &&
__predict_true((tf->tf_spsr & I32_bit) == 0))
enable_interrupts(I32_bit);
@@ -1007,7 +1008,7 @@ swi_handler(trapframe_t *frame)
* Since all syscalls *should* come from user mode it will always
* be safe to enable them, but check anyway.
*/
- if (td->td_critnest == 0 && !(frame->tf_spsr & I32_bit))
+ if (td->td_md.md_spinlock_count == 0 && !(frame->tf_spsr & I32_bit))
enable_interrupts(I32_bit);
syscall(td, frame, insn);
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index c6945af..d392374 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -240,11 +240,11 @@ trap(frame)
type);
/*
* Page faults need interrupts disabled until later,
- * and we shouldn't enable interrupts while in a
- * critical section or if servicing an NMI.
+ * and we shouldn't enable interrupts while holding
+ * a spin lock or if servicing an NMI.
*/
if (type != T_NMI && type != T_PAGEFLT &&
- td->td_critnest == 0)
+ td->td_md.md_spinlock_count == 0)
enable_intr();
}
}
OpenPOWER on IntegriCloud