🎈 perf: perf rt_hw_interrupt_disable/enable (#8042)

Signed-off-by: Shell <smokewood@qq.com>
Co-authored-by: Shell <smokewood@qq.com>
This commit is contained in:
xqyjlj
2023-10-25 20:31:25 +08:00
committed by GitHub
parent 91fc52df36
commit 3283f54c7a
80 changed files with 2478 additions and 1962 deletions

View File

@@ -32,6 +32,8 @@ struct rt_poll_node
struct rt_poll_node *next;
};
static RT_DEFINE_SPINLOCK(_spinlock);
static int __wqueue_pollwake(struct rt_wqueue_node *wait, void *key)
{
struct rt_poll_node *pn;
@@ -85,7 +87,7 @@ static int poll_wait_timeout(struct rt_poll_table *pt, int msec)
timeout = rt_tick_from_millisecond(msec);
level = rt_hw_interrupt_disable();
level = rt_spin_lock_irqsave(&_spinlock);
if (timeout != 0 && !pt->triggered)
{
@@ -99,16 +101,16 @@ static int poll_wait_timeout(struct rt_poll_table *pt, int msec)
rt_timer_start(&(thread->thread_timer));
}
rt_hw_interrupt_enable(level);
rt_spin_unlock_irqrestore(&_spinlock, level);
rt_schedule();
level = rt_hw_interrupt_disable();
level = rt_spin_lock_irqsave(&_spinlock);
}
}
ret = !pt->triggered;
rt_hw_interrupt_enable(level);
rt_spin_unlock_irqrestore(&_spinlock, level);
return ret;
}