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.
This commit is contained in:
John Baldwin 2006-01-06 18:02:12 +00:00
parent af56abaab5
commit 360c3c2d1a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154074
3 changed files with 10 additions and 9 deletions

View file

@ -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();
}
}

View file

@ -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);

View file

@ -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();
}
}