[src] Fixup UP irq_spinlock
Use scheduler lock in up irq_spinlock to avoid scheduling during spinlock. Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
parent
4ea463d83f
commit
2aacba2c86
|
@ -632,11 +632,13 @@ rt_inline rt_base_t rt_spin_lock_irqsave(struct rt_spinlock *lock)
|
||||||
rt_base_t level;
|
rt_base_t level;
|
||||||
RT_UNUSED(lock);
|
RT_UNUSED(lock);
|
||||||
level = rt_hw_interrupt_disable();
|
level = rt_hw_interrupt_disable();
|
||||||
|
rt_enter_critical();
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
rt_inline void rt_spin_unlock_irqrestore(struct rt_spinlock *lock, rt_base_t level)
|
rt_inline void rt_spin_unlock_irqrestore(struct rt_spinlock *lock, rt_base_t level)
|
||||||
{
|
{
|
||||||
RT_UNUSED(lock);
|
RT_UNUSED(lock);
|
||||||
|
rt_exit_critical();
|
||||||
rt_hw_interrupt_enable(level);
|
rt_hw_interrupt_enable(level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue