diff options
-rw-r--r-- | sys/amd64/amd64/trap.c | 6 | ||||
-rw-r--r-- | sys/arm/arm/trap.c | 7 | ||||
-rw-r--r-- | sys/i386/i386/trap.c | 6 |
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(); } } |