mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
Use selrecord() instead of doing the work ourselves.
This commit is contained in:
parent
92ad4dfbd1
commit
172c0b6aec
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71492
@ -865,7 +865,6 @@ ascpoll(dev_t dev, int events, struct proc *p)
|
||||
int unit = UNIT(minor(dev));
|
||||
struct asc_unit *scu = unittab + unit;
|
||||
int sps;
|
||||
struct proc *p1;
|
||||
int revents = 0;
|
||||
|
||||
sps=spltty();
|
||||
@ -877,11 +876,7 @@ ascpoll(dev_t dev, int events, struct proc *p)
|
||||
if (!(scu->flags & DMA_ACTIVE))
|
||||
dma_restart(scu);
|
||||
|
||||
if (scu->selp.si_pid && (p1=pfind(scu->selp.si_pid))
|
||||
&& p1->p_wchan == (caddr_t)&selwait)
|
||||
scu->selp.si_flags = SI_COLL;
|
||||
else
|
||||
scu->selp.si_pid = p->p_pid;
|
||||
selrecord(p, &scu->selp);
|
||||
}
|
||||
}
|
||||
splx(sps);
|
||||
|
@ -567,7 +567,6 @@ static int
|
||||
pcapoll(dev_t dev, int events, struct proc *p)
|
||||
{
|
||||
int s;
|
||||
struct proc *p1;
|
||||
int revents = 0;
|
||||
|
||||
s = spltty();
|
||||
@ -576,14 +575,8 @@ pcapoll(dev_t dev, int events, struct proc *p)
|
||||
if (!pca_status.in_use[0] || !pca_status.in_use[1] ||
|
||||
!pca_status.in_use[2])
|
||||
revents |= events & (POLLOUT | POLLWRNORM);
|
||||
else {
|
||||
if (pca_status.wsel.si_pid &&
|
||||
(p1=pfind(pca_status.wsel.si_pid))
|
||||
&& p1->p_wchan == (caddr_t)&selwait)
|
||||
pca_status.wsel.si_flags = SI_COLL;
|
||||
else
|
||||
pca_status.wsel.si_pid = p->p_pid;
|
||||
}
|
||||
else
|
||||
selrecord(p, &pca_status.wsel);
|
||||
}
|
||||
splx(s);
|
||||
return (revents);
|
||||
|
Loading…
Reference in New Issue
Block a user