Also remove unneeded seltrue() and selfalse().
OK mpi@ jsg@
-.\" $OpenBSD: ps.1,v 1.125 2022/03/31 17:27:14 naddy Exp $
+.\" $OpenBSD: ps.1,v 1.126 2022/07/05 15:06:16 visa Exp $
.\" $NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
.\"
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\"
-.Dd $Mdocdate: March 31 2022 $
+.Dd $Mdocdate: July 5 2022 $
.Dt PS 1
.Os
.Sh NAME
P_ALRMPEND 0x4 this thread needs SIGVTALRM
P_SIGSUSPEND 0x8 need to restore before-suspend mask
P_CANTSLEEP 0x10 this thread is not permitted to sleep
-P_SELECT 0x40 selecting; wakeup/waiting danger
P_SINTR 0x80 sleep is interruptible
P_SYSTEM 0x200 system process: no sigs, stats, or
swapping
-/* $OpenBSD: wsdisplay.c,v 1.146 2022/07/02 08:50:42 visa Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.147 2022/07/05 15:06:16 visa Exp $ */
/* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */
/*
splx(s);
return;
}
- if (tp->t_outq.c_cc == 0 && tp->t_wsel.si_seltid == 0)
+ if (tp->t_outq.c_cc == 0)
goto low;
if ((scr = sc->sc_scr[WSDISPLAYSCREEN(tp->t_dev)]) == NULL) {
-/* $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 $ */
/*-
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;
{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},
-/* $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 $ */
/*
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,
return (error);
}
-int selwait, nselcoll;
-
/*
* Select system call.
*/
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.
*/
{
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.
*/
-/* $OpenBSD: bpf.c,v 1.217 2022/07/02 08:50:42 visa Exp $ */
+/* $OpenBSD: bpf.c,v 1.218 2022/07/05 15:06:16 visa Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
KNOTE(&d->bd_sel.si_note, 0);
/*
- * As long as pgsigio() and selwakeup() need to be protected
+ * As long as pgsigio() needs to be protected
* by the KERNEL_LOCK() we have to delay the wakeup to
* another context to keep the hot path KERNEL_LOCK()-free.
*/
- if ((d->bd_async && d->bd_sig) || d->bd_sel.si_seltid != 0) {
+ if (d->bd_async && d->bd_sig) {
bpf_get(d);
if (!task_add(systq, &d->bd_wake_task))
bpf_put(d);
if (d->bd_async && d->bd_sig)
pgsigio(&d->bd_sigio, d->bd_sig, 0);
- mtx_enter(&d->bd_mtx);
- selwakeup(&d->bd_sel);
- mtx_leave(&d->bd_mtx);
bpf_put(d);
}
{
struct bpf_d *d = kn->kn_hook;
- if (hint == NOTE_SUBMIT) /* ignore activation from selwakeup */
- return (0);
-
MUTEX_ASSERT_LOCKED(&d->bd_mtx);
kn->kn_data = d->bd_hlen;
-/* $OpenBSD: proc.h,v 1.332 2022/06/29 12:17:31 jca Exp $ */
+/* $OpenBSD: proc.h,v 1.333 2022/07/05 15:06:16 visa Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
#define P_ALRMPEND 0x00000004 /* SIGVTALRM needs to be posted */
#define P_SIGSUSPEND 0x00000008 /* Need to restore before-suspend mask*/
#define P_CANTSLEEP 0x00000010 /* insomniac thread */
-#define P_SELECT 0x00000040 /* Selecting; wakeup/waiting danger. */
#define P_SINTR 0x00000080 /* Sleep is interruptible. */
#define P_SYSTEM 0x00000200 /* No sigs, stats or swapping. */
#define P_TIMEOUT 0x00000400 /* Timing out during sleep. */
#define P_BITS \
("\20" "\01INKTR" "\02PROFPEND" "\03ALRMPEND" "\04SIGSUSPEND" \
- "\05CANTSLEEP" "\07SELECT" "\010SINTR" "\012SYSTEM" "\013TIMEOUT" \
+ "\05CANTSLEEP" "\010SINTR" "\012SYSTEM" "\013TIMEOUT" \
"\016WEXIT" "\020OWEUPC" "\024SUSPSINGLE" "\027XX" \
"\030CONTINUED" "\033THREAD" "\034SUSPSIG" "\035SOFTDEP" "\037CPUPEG")
-/* $OpenBSD: selinfo.h,v 1.5 2017/07/18 19:20:26 sf Exp $ */
+/* $OpenBSD: selinfo.h,v 1.6 2022/07/05 15:06:16 visa Exp $ */
/*-
* Copyright (c) 1992, 1993
*/
struct selinfo {
struct klist si_note; /* kernel note list */
- pid_t si_seltid; /* thread to be notified */
- short si_flags; /* see below */
};
-#define SI_COLL 0x0001 /* collision occurred */
#ifdef _KERNEL
-struct proc;
-
-void selrecord(struct proc *selector, struct selinfo *);
void selwakeup(struct selinfo *);
#endif
-/* $OpenBSD: systm.h,v 1.155 2021/12/09 00:26:10 guenther Exp $ */
+/* $OpenBSD: systm.h,v 1.156 2022/07/05 15:06:16 visa Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
extern int nblkdev; /* number of entries in bdevsw */
extern int nchrdev; /* number of entries in cdevsw */
-extern int selwait; /* select timeout address */
extern int maxmem; /* max memory per process */
extern int physmem; /* physical memory */
int enxio(void);
int eopnotsupp(void *);
-int seltrue(dev_t dev, int which, struct proc *);
-int selfalse(dev_t dev, int which, struct proc *);
void *hashinit(int, int, int, u_long *);
void hashfree(void *, int, int);
int sys_nosys(struct proc *, void *, register_t *);