poll: add poll_notify() api and call it in all drivers

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
This commit is contained in:
wangbowen6
2022-09-19 11:08:57 +08:00
committed by Xiang Xiao
parent 74842880f9
commit 344c8be049
83 changed files with 289 additions and 1441 deletions
+2 -15
View File
@@ -199,7 +199,6 @@ static int ramlog_readnotify(FAR struct ramlog_dev_s *priv)
static void ramlog_pollnotify(FAR struct ramlog_dev_s *priv,
pollevent_t eventset)
{
FAR struct pollfd *fds;
irqstate_t flags;
int i;
@@ -208,16 +207,7 @@ static void ramlog_pollnotify(FAR struct ramlog_dev_s *priv,
for (i = 0; i < CONFIG_RAMLOG_NPOLLWAITERS; i++)
{
flags = enter_critical_section();
fds = priv->rl_fds[i];
if (fds)
{
fds->revents |= (fds->events & eventset);
if (fds->revents != 0)
{
nxsem_post(fds->sem);
}
}
poll_notify(&priv->rl_fds[i], 1, eventset);
leave_critical_section(flags);
}
}
@@ -741,10 +731,7 @@ static int ramlog_file_poll(FAR struct file *filep, FAR struct pollfd *fds,
leave_critical_section(flags);
if (eventset)
{
ramlog_pollnotify(priv, eventset);
}
ramlog_pollnotify(priv, eventset);
}
else if (fds->priv)
{