🎈 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
co-authored by Shell
parent 91fc52df36
commit 3283f54c7a
80 changed files with 2478 additions and 1962 deletions
+4 -2
View File
@@ -79,6 +79,8 @@ struct lwip_sock {
};
#endif /* LWIP_VERSION >= 0x20100ff */
static RT_DEFINE_SPINLOCK(_spinlock);
extern struct lwip_sock *lwip_tryget_socket(int s);
static void event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len)
@@ -262,7 +264,7 @@ static int inet_poll(struct dfs_file *file, struct rt_pollreq *req)
rt_poll_add(&sock->wait_head, req);
level = rt_hw_interrupt_disable();
level = rt_spin_lock_irqsave(&_spinlock);
#if LWIP_VERSION >= 0x20100ff
if ((void*)(sock->lastdata.pbuf) || sock->rcvevent)
@@ -282,7 +284,7 @@ static int inet_poll(struct dfs_file *file, struct rt_pollreq *req)
/* clean error event */
sock->errevent = 0;
}
rt_hw_interrupt_enable(level);
rt_spin_unlock_irqrestore(&_spinlock, level);
}
return mask;