mirror of
https://github.com/opnsense/src.git
synced 2026-03-14 22:53:16 -04:00
Disable interrupts first and then set spinlock_count to 1.
Otherwise interrupt can be generated just after setting spinlock_count and before disabling interrupts. Sponsored by: DARPA, AFRL
This commit is contained in:
parent
75cf8837a9
commit
bf03b1f1f9
1 changed files with 3 additions and 1 deletions
|
|
@ -457,11 +457,13 @@ void
|
|||
spinlock_enter(void)
|
||||
{
|
||||
struct thread *td;
|
||||
register_t reg;
|
||||
|
||||
td = curthread;
|
||||
if (td->td_md.md_spinlock_count == 0) {
|
||||
reg = intr_disable();
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_sstatus_ie = intr_disable();
|
||||
td->td_md.md_saved_sstatus_ie = reg;
|
||||
} else
|
||||
td->td_md.md_spinlock_count++;
|
||||
critical_enter();
|
||||
|
|
|
|||
Loading…
Reference in a new issue