summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2022-07-05 15:06:17 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2022-07-05 15:06:17 +0000
commitba972f05cd896f5060136923e8d4210da2d5781f (patch)
tree2e89544b67312a1edd5093bde3a63e1b50810495 /sys/kern
parent392cb2fcdec20c53f29dc0165ae9f1cbc5a3cd6e (diff)
Remove old poll/select wakeup mechanism.
Also remove unneeded seltrue() and selfalse(). OK mpi@ jsg@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sysctl.c6
-rw-r--r--sys/kern/sys_generic.c65
2 files changed, 4 insertions, 67 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 326265d56f2..f9d1f04a845 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.402 2022/03/21 09:12:34 bluhm Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.403 2022/07/05 15:06:16 visa Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -120,7 +120,7 @@
extern struct forkstat forkstat;
extern struct nchstats nchstats;
-extern int nselcoll, fscale;
+extern int fscale;
extern fixpt_t ccpu;
extern long numvnodes;
extern int allowdt;
@@ -298,7 +298,7 @@ const struct sysctl_bounded_args kern_vars[] = {
{KERN_NFILES, &numfiles, SYSCTL_INT_READONLY},
{KERN_TTYCOUNT, &tty_count, SYSCTL_INT_READONLY},
{KERN_ARGMAX, &arg_max, SYSCTL_INT_READONLY},
- {KERN_NSELCOLL, &nselcoll, SYSCTL_INT_READONLY},
+ {KERN_NSELCOLL, &int_zero, SYSCTL_INT_READONLY},
{KERN_POSIX1, &posix_version, SYSCTL_INT_READONLY},
{KERN_NGROUPS, &ngroups_max, SYSCTL_INT_READONLY},
{KERN_JOB_CONTROL, &int_one, SYSCTL_INT_READONLY},
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index d65ab2d3ff6..3beaac8f82a 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.147 2022/02/08 08:56:41 visa Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.148 2022/07/05 15:06:16 visa Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -89,7 +89,6 @@ int dopselect(struct proc *, int, fd_set *, fd_set *, fd_set *,
struct timespec *, const sigset_t *, register_t *);
int doppoll(struct proc *, struct pollfd *, u_int, struct timespec *,
const sigset_t *, register_t *);
-void doselwakeup(struct selinfo *);
int
iovec_copyin(const struct iovec *uiov, struct iovec **iovp, struct iovec *aiov,
@@ -522,8 +521,6 @@ out:
return (error);
}
-int selwait, nselcoll;
-
/*
* Select system call.
*/
@@ -840,41 +837,6 @@ pselcollect(struct proc *p, struct kevent *kevp, fd_set *pobits[3],
return (0);
}
-int
-seltrue(dev_t dev, int events, struct proc *p)
-{
-
- return (events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM));
-}
-
-int
-selfalse(dev_t dev, int events, struct proc *p)
-{
-
- return (0);
-}
-
-/*
- * Record a select request.
- */
-void
-selrecord(struct proc *selector, struct selinfo *sip)
-{
- struct proc *p;
- pid_t mytid;
-
- KERNEL_ASSERT_LOCKED();
-
- mytid = selector->p_tid;
- if (sip->si_seltid == mytid)
- return;
- if (sip->si_seltid && (p = tfind(sip->si_seltid)) &&
- p->p_wchan == (caddr_t)&selwait)
- sip->si_flags |= SI_COLL;
- else
- sip->si_seltid = mytid;
-}
-
/*
* Do a wakeup when a selectable event occurs.
*/
@@ -883,34 +845,9 @@ selwakeup(struct selinfo *sip)
{
KERNEL_LOCK();
KNOTE(&sip->si_note, NOTE_SUBMIT);
- doselwakeup(sip);
KERNEL_UNLOCK();
}
-void
-doselwakeup(struct selinfo *sip)
-{
- struct proc *p;
-
- KERNEL_ASSERT_LOCKED();
-
- if (sip->si_seltid == 0)
- return;
- if (sip->si_flags & SI_COLL) {
- nselcoll++;
- sip->si_flags &= ~SI_COLL;
- wakeup(&selwait);
- }
- p = tfind(sip->si_seltid);
- sip->si_seltid = 0;
- if (p != NULL) {
- if (wakeup_proc(p, &selwait)) {
- /* nothing else to do */
- } else if (p->p_flag & P_SELECT)
- atomic_clearbits_int(&p->p_flag, P_SELECT);
- }
-}
-
/*
* Only copyout the revents field.
*/