kernel - Tear out selwakeup()
authorSamuel J. Greear <sjg@thesjg.com>
Wed, 14 Jul 2010 20:03:31 +0000 (20:03 +0000)
committerSamuel J. Greear <sjg@thesjg.com>
Wed, 14 Jul 2010 20:03:31 +0000 (20:03 +0000)
50 files changed:
sys/bus/cam/scsi/scsi_target.c
sys/bus/firewire/firewire.c
sys/bus/usb/usb.c
sys/bus/usb/usb_port.h
sys/dev/acpica5/acpi.c
sys/dev/misc/cmx/cmx.c
sys/dev/misc/hotplug/hotplug.c
sys/dev/misc/kbd/kbd.c
sys/dev/misc/mse/mse.c
sys/dev/misc/nmdm/nmdm.c
sys/dev/misc/psm/psm.c
sys/dev/misc/snp/snp.c
sys/dev/misc/spic/spic.c
sys/dev/misc/tw/tw.c
sys/dev/raid/aac/aac.c
sys/dev/serial/dgb/dgm.c
sys/dev/serial/stl/stallion.c
sys/dev/serial/stli/istallion.c
sys/dev/sound/pcm/buffer.c
sys/dev/sound/pcm/channel.c
sys/dev/usbmisc/ucom/ucom.c
sys/dev/usbmisc/ugen/ugen.c
sys/dev/usbmisc/uhid/uhid.c
sys/dev/usbmisc/ums/ums.c
sys/dev/video/bktr/bktr_core.c
sys/dev/video/cxm/cxm.c
sys/kern/kern_event.c
sys/kern/kern_udev.c
sys/kern/subr_bus.c
sys/kern/subr_log.c
sys/kern/sys_generic.c
sys/kern/sys_mqueue.c
sys/kern/sys_pipe.c
sys/kern/tty.c
sys/kern/tty_pty.c
sys/kern/uipc_socket.c
sys/kern/uipc_socket2.c
sys/net/bpf.c
sys/net/i4b/driver/i4b_rbch.c
sys/net/i4b/driver/i4b_tel.c
sys/net/i4b/layer4/i4b_i4bdrv.c
sys/net/tap/if_tap.c
sys/net/tun/if_tun.c
sys/platform/pc32/apm/apm.c
sys/platform/pc32/isa/asc.c
sys/platform/pc64/apm/apm.c
sys/platform/pc64/isa/asc.c
sys/sys/eventvar.h
sys/sys/selinfo.h
sys/sys/socketvar.h

index e3e2379..28f753e 100644 (file)
@@ -1119,7 +1119,6 @@ notify_user(struct targ_softc *softc)
         * Notify users sleeping via poll(), kqueue(), and
         * blocking read().
         */
-       selwakeup(&softc->read_select);
        KNOTE(&softc->read_select.si_note, 0);
        wakeup(&softc->user_ccb_queue);
 }
index 145caa7..5031a70 100644 (file)
@@ -1950,12 +1950,6 @@ fw_rcv(struct fw_rcv_buf *rb)
                STAILQ_INSERT_TAIL(&xferq->q, rb->xfer, link);
                crit_exit();
                sc = device_get_softc(rb->fc->bdev);
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
-               if (&xferq->rsel.si_pid != 0)
-#else
-               if (SEL_WAITING(&xferq->rsel))
-#endif
-                       selwakeuppri(&xferq->rsel, FWPRI);
                KNOTE(&xferq->rsel.si_note, 0);
                if (xferq->flag & FWXFERQ_WAKEUP) {
                        xferq->flag &= ~FWXFERQ_WAKEUP;
index 8c0b571..1bf35da 100644 (file)
@@ -870,7 +870,6 @@ usb_add_event(int type, struct usb_event *uep)
        TAILQ_INSERT_TAIL(&usb_events, ueq, next);
        usb_nevents++;
        wakeup(&usb_events);
-       selwakeup(&usb_selevent);
        KNOTE(&usb_selevent.si_note, 0);
        if (usb_async_proc != NULL) {
                ksignal(usb_async_proc, SIGIO);
index 1b7128a..0a133e6 100644 (file)
@@ -81,8 +81,6 @@
 #define        PROC_UNLOCK(p)
 #define uio_procp uio_td
 
-#define selwakeuppri(p, pri)   selwakeup(p)
-
 typedef struct thread *usb_proc_ptr;
 
 #define        config_pending_incr()
index ac2974a..b39c2b1 100644 (file)
@@ -2241,8 +2241,7 @@ acpi_ReqSleepState(struct acpi_softc *sc, int state)
     STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) {
        clone->notify_status = APM_EV_NONE;
        if ((clone->flags & ACPI_EVF_DEVD) == 0) {
-           selwakeuppri(&clone->sel_read, PZERO);
-           KNOTE_UNLOCKED(&clone->sel_read.si_note, 0);
+           KNOTE(&clone->sel_read.si_note, 0);
        }
     }
 #endif
index 54ccb3e..63c39dd 100644 (file)
@@ -281,7 +281,6 @@ cmx_detach(device_t dev)
                callout_stop(&sc->ch);
                sc->polling = 0;
                CMX_UNLOCK(sc);
-               selwakeup(&sc->sel);
                KNOTE(&sc->sel.si_note, 0);
        } else {
                CMX_UNLOCK(sc);
@@ -405,7 +404,6 @@ cmx_tick(void *xsc)
                DEBUG_printf(sc->dev, "BSR=%b\n", bsr, BSRBITS);
                if (cmx_test(bsr, BSR_BULK_IN_FULL, 1)) {
                        sc->polling = 0;
-                       selwakeup(&sc->sel);
                        KNOTE(&sc->sel.si_note, 0);
                } else {
                        callout_reset(&sc->ch, POLL_TICKS, cmx_tick, sc);
@@ -464,7 +462,6 @@ cmx_close(struct dev_close_args *ap)
                callout_stop(&sc->ch);
                sc->polling = 0;
                CMX_UNLOCK(sc);
-               selwakeup(&sc->sel);
                KNOTE(&sc->sel.si_note, 0);
                CMX_LOCK(sc);
        }
@@ -506,7 +503,6 @@ cmx_read(struct dev_read_args *ap)
                callout_stop(&sc->ch);
                sc->polling = 0;
                CMX_UNLOCK(sc);
-               selwakeup(&sc->sel);
                KNOTE(&sc->sel.si_note, 0);
        } else {
                CMX_UNLOCK(sc);
index a16d719..2c7d64f 100644 (file)
@@ -221,7 +221,6 @@ hotplug_put_event(struct hotplug_event *he)
        hpsc.qcount++;
        wakeup(&hpsc);
        lockmgr(&hpsc.lock, LK_RELEASE);
-       selwakeup(&hpsc.sel);
        KNOTE(&hpsc.sel.si_note, 0);
        return (0);
 }
index eb1437a..3029768 100644 (file)
@@ -836,7 +836,6 @@ genkbd_event(keyboard_t *kbd, int event, void *arg)
                        sc->gkb_flags &= ~KB_ASLEEP;
                        wakeup((caddr_t)sc);
                }
-               selwakeup(&sc->gkb_rsel);
                KNOTE(&sc->gkb_rsel.si_note, 0);
                return 0;
        default:
@@ -907,7 +906,6 @@ genkbd_event(keyboard_t *kbd, int event, void *arg)
                        sc->gkb_flags &= ~KB_ASLEEP;
                        wakeup((caddr_t)sc);
                }
-               selwakeup(&sc->gkb_rsel);
                KNOTE(&sc->gkb_rsel.si_note, 0);
        }
 
index a14a7a8..05d1033 100644 (file)
@@ -757,7 +757,6 @@ mseintr(void *arg)
                        sc->sc_flags &= ~MSESC_WANT;
                        wakeup((caddr_t)sc);
                }
-               selwakeup(&sc->sc_selp);
                KNOTE(&sc->sc_selp.si_note, 0);
        }
 }
index f07a921..701b0fa 100644 (file)
@@ -441,12 +441,10 @@ wakeup_other(struct tty *tp, int flag)
 
        GETPARTS(tp, ourpart, otherpart);
        if (flag & FREAD) {
-               selwakeup(&otherpart->nm_tty.t_rsel);
                wakeup(TSA_PTC_READ((&otherpart->nm_tty)));
                KNOTE(&otherpart->nm_tty.t_rsel.si_note, 0);
        }
        if (flag & FWRITE) {
-               selwakeup(&otherpart->nm_tty.t_wsel);
                wakeup(TSA_PTC_WRITE((&otherpart->nm_tty)));
                KNOTE(&otherpart->nm_tty.t_wsel.si_note, 0);
        }
index 2e63d76..d502c83 100644 (file)
@@ -2377,7 +2377,6 @@ psmintr(void *arg)
             sc->state &= ~PSM_ASLP;
             wakeup((caddr_t) sc);
        }
-        selwakeup(&sc->rsel);
        KNOTE(&sc->rsel.si_note, 0);
     }
 }
index 003f4c5..0e63fe6 100644 (file)
@@ -365,8 +365,6 @@ snp_in(struct snoop *snp, char *buf, int n)
                snp->snp_flags &= ~SNOOP_RWAIT;
                wakeup((caddr_t)snp);
        }
-       selwakeup(&snp->snp_sel);
-       snp->snp_sel.si_pid = 0;
        KNOTE(&snp->snp_sel.si_note, 0);
 
        return (n);
@@ -439,8 +437,6 @@ snp_detach(struct snoop *snp)
        snp->snp_target = NULL;
 
 detach_notty:
-       selwakeup(&snp->snp_sel);
-       snp->snp_sel.si_pid = 0;
        KNOTE(&snp->snp_sel.si_note, 0);
        if ((snp->snp_flags & SNOOP_OPEN) == 0) 
                kfree(snp, M_SNP);
index 9e1ae0b..0d5d97b 100644 (file)
@@ -438,7 +438,6 @@ spictimeout(void *arg)
                        sc->sc_sleeping = 0;
                        wakeup((caddr_t) sc);
                }
-               selwakeup(&sc->sc_rsel);
                KNOTE(&sc->sc_rsel.si_note, 0);
        }
        spic_call2(sc, 0x81, 0xff); /* Clear event */
index 72d4468..2711092 100644 (file)
@@ -882,7 +882,6 @@ twputpkt(struct tw_sc *sc, u_char *p)
     sc->sc_state &= ~TWS_WANT;
     wakeup((caddr_t)(&sc->sc_buf));
   }
-  selwakeup(&sc->sc_selp);
   KNOTE(&sc->sc_selp.si_note, 0);
   return(0);
 }
index ec2453e..d40ed53 100644 (file)
@@ -3379,7 +3379,6 @@ aac_handle_aif(struct aac_softc *sc, struct aac_fib *fib)
                        wakeup(sc->aac_aifq);
                /* token may have been lost */
                /* Wakeup any poll()ers */
-               selwakeup(&sc->rcv_select);
                KNOTE(&sc->rcv_select.si_note, 0);
                /* token may have been lost */
        }
index 02b07e4..38cea81 100644 (file)
@@ -1393,14 +1393,13 @@ dgmpoll(void *unit_c)
                                                if (!(tp->t_state & TS_BUSY)) {
                                                        hidewin(sc);
 #ifndef TS_ASLEEP      /* post 2.0.5 FreeBSD */
-                                                       ttwwakeup(tp);
+                                                       ttwwakeup(tp); /* Issues KNOTE() */
 #else
                                                        if (tp->t_outq.c_cc <= tp->t_lowat) {
                                                                if (tp->t_state & TS_ASLEEP) {
                                                                        tp->t_state &= ~TS_ASLEEP;
                                                                        wakeup(TSA_OLOWAT(tp));
                                                                }
-                                                               /* selwakeup(&tp->t_wsel); */
                                                        }
 #endif
                                                        setwin(sc, 0);
@@ -2021,14 +2020,13 @@ dgmstart(struct tty *tp)
 
        while (tp->t_outq.c_cc != 0) {
 #ifndef TS_ASLEEP      /* post 2.0.5 FreeBSD */
-               ttwwakeup(tp);
+               ttwwakeup(tp); /* Issues KNOTE() */
 #else
                if (tp->t_outq.c_cc <= tp->t_lowat) {
                        if (tp->t_state & TS_ASLEEP) {
                                tp->t_state &= ~TS_ASLEEP;
                                wakeup(TSA_OLOWAT(tp));
                        }
-                       /*selwakeup(&tp->t_wsel);*/
                }
 #endif
                crit_enter();
index 460fd57..b6e6183 100644 (file)
@@ -1634,7 +1634,6 @@ static void stl_start(struct tty *tp)
                        tp->t_state &= ~TS_ASLEEP;
                        wakeup(&tp->t_outq);
                }
-               selwakeup(&tp->t_wsel);
                KNOTE(&tp->t_wsel.si_note, 0);
        }
 #endif
index 6500412..1557ec4 100644 (file)
@@ -1670,7 +1670,6 @@ static void stli_start(struct tty *tp)
                        tp->t_state &= ~TS_ASLEEP;
                        wakeup(&tp->t_outq);
                }
-               selwakeup(&tp->t_wsel);
                KNOTE(&tp->t_wsel.si_note, 0);
        }
 #endif
index a6ae308..6f0f342 100644 (file)
 SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/buffer.c,v 1.11 2008/01/06 16:55:51 swildner Exp $");
 
 /*
+ * XXX
+ *
  * sndbuf_seltask is a taskqueue callback routine, called from
  * taskqueue_swi, which runs under the MP lock.
  *
- * The only purpose is to be able to selwakeup() from a sound
+ * The only purpose is to be able to KNOTE() from a sound
  * interrupt, which is running without MP lock held and thus
- * can't call selwakeup() directly.
+ * can't call KNOTE() directly.
  */
 static void
 sndbuf_seltask(void *context, int pending)
@@ -47,7 +49,6 @@ sndbuf_seltask(void *context, int pending)
        struct snd_dbuf *b = context;
        struct selinfo *si = sndbuf_getsel(b);
 
-       selwakeup(si);
        KNOTE(&si->si_note, 0);
 }
 
index 54fffca..a0c5370 100644 (file)
@@ -143,7 +143,9 @@ chn_wakeup(struct pcm_channel *c)
                /*if (SEL_WAITING(sndbuf_getsel(bs)) && chn_polltrigger(c))*/
                if (sndbuf_getsel(bs)->si_pid && chn_polltrigger(c)) {
                        /*
-                        * We would call selwakeup() here, but as we
+                        * XXX
+                        *
+                        * We would call KNOTE() here, but as we
                         * are in interrupt context, we'd have to
                         * acquire the MP lock before.
                         * Instead, we'll queue a task in a software
@@ -151,7 +153,7 @@ chn_wakeup(struct pcm_channel *c)
                         * held.
                         *
                         * buffer.c:sndbuf_seltask will then call
-                        * selwakeup() from safer context.
+                        * KNOTE() from safer context.
                         */
                        taskqueue_enqueue(taskqueue_swi, &bs->seltask);
                }
index 3df457e..a710205 100644 (file)
@@ -874,7 +874,6 @@ ucomstart(struct tty *tp)
                        CLR(tp->t_state, TS_SO_OLOWAT);
                        wakeup(TSA_OLOWAT(tp));
                }
-               selwakeup(&tp->t_wsel);
                KNOTE(&tp->t_wsel.si_note, 0);
                if (tp->t_outq.c_cc == 0) {
                        if (ISSET(tp->t_state, TS_BUSY | TS_SO_OCOMPLETE) ==
index 4f02193..e0a85f0 100644 (file)
@@ -914,7 +914,6 @@ ugen_detach(device_t self)
                        sce = &sc->sc_endpoints[i][dir];
                        if (sce && sce->pipeh)
                                usbd_abort_pipe(sce->pipeh);
-                       selwakeup(&sce->rsel);
                        KNOTE(&sce->rsel.si_note, 0);
                }
        }
@@ -969,7 +968,6 @@ ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
                DPRINTFN(5, ("ugen_intr: waking %p\n", sce));
                wakeup(sce);
        }
-       selwakeup(&sce->rsel);
        KNOTE(&sce->rsel.si_note, 0);
 }
 
@@ -1030,7 +1028,6 @@ ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
                DPRINTFN(5, ("ugen_isoc_rintr: waking %p\n", sce));
                wakeup(sce);
        }
-       selwakeup(&sce->rsel);
        KNOTE(&sce->rsel.si_note, 0);
 }
 
index a49a36d..c48e7f7 100644 (file)
@@ -333,7 +333,6 @@ uhid_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
                DPRINTFN(5, ("uhid_intr: waking %p\n", &sc->sc_q));
                wakeup(&sc->sc_q);
        }
-       selwakeup(&sc->sc_rsel);
        KNOTE(&sc->sc_rsel.si_note, 0);
        if (sc->sc_async != NULL) {
                DPRINTFN(3, ("uhid_intr: sending SIGIO %p\n", sc->sc_async));
index 193041b..292b47d 100644 (file)
@@ -381,7 +381,6 @@ ums_detach(device_t self)
                sc->state &= ~UMS_ASLEEP;
                wakeup(sc);
        }
-       selwakeup(&sc->rsel);
        KNOTE(&sc->rsel.si_note, 0);
 
        dev_ops_remove_minor(&ums_ops, /*-1, */device_get_unit(self));
@@ -514,7 +513,6 @@ ums_add_to_queue(struct ums_softc *sc, int dx, int dy, int dz, int buttons)
                sc->state &= ~UMS_ASLEEP;
                wakeup(sc);
        }
-       selwakeup(&sc->rsel);
        KNOTE(&sc->rsel.si_note, 0);
 }
 
index 40492ad..ef94642 100644 (file)
@@ -713,10 +713,7 @@ common_bktr_intr( void *arg )
                        wakeup(VBI_SLEEP);
                }
 
-               /* If someone has a select() on /dev/vbi, inform them */
-               if (bktr->vbi_select.si_pid) {
-                       selwakeup(&bktr->vbi_select);
-               }
+               /* Inform anyone who is polling */
                KNOTE(&bktr->vbi_select.si_note, 0);
 
        }
index 1c608cc..354e516 100644 (file)
@@ -1370,7 +1370,6 @@ cxm_encoder_dma_done(struct cxm_softc *sc)
        wakeup(&sc->enc_pool.read);
 
        /* wakeup anyone polling for data */
-       selwakeup(&sc->enc_sel);
        KNOTE(&sc->enc_sel.si_note, 0);
 }
 
index 91bb3e1..b2bfbcf 100644 (file)
@@ -1074,10 +1074,6 @@ kqueue_wakeup(struct kqueue *kq)
                kq->kq_state &= ~KQ_SLEEP;
                wakeup(kq);
        }
-       if (kq->kq_state & KQ_SEL) {
-               kq->kq_state &= ~KQ_SEL;
-               selwakeup(&kq->kq_sel);
-       }
        KNOTE(&kq->kq_sel.si_note, 0);
 }
 
index fe1339d..6422b45 100644 (file)
@@ -422,7 +422,6 @@ udev_event_insert(int ev_type, prop_dictionary_t dict)
        lockmgr(&udevctx.lock, LK_RELEASE);
 
        wakeup(&udevctx);
-       selwakeup(&udevctx.sel);
        KNOTE(&udevctx.sel.si_note, 0);
 }
 
index baff226..24f8eca 100644 (file)
@@ -367,7 +367,6 @@ devctl_queue_data(char *data)
        wakeup(&devsoftc);
        lockmgr(&devsoftc.lock, LK_RELEASE);
        get_mplock();   /* XXX */
-       selwakeup(&devsoftc.sel);
        KNOTE(&devsoftc.sel.si_note, 0);
        rel_mplock();   /* XXX */
        p = devsoftc.async_proc;
index 6de6e59..479e6ba 100644 (file)
@@ -223,7 +223,6 @@ logtimeout(void *arg)
                return;
        }
        msgbuftrigger = 0;
-       selwakeup(&logsoftc.sc_selp);
        KNOTE(&logsoftc.sc_selp.si_note, 0);
        if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL)
                pgsigio(logsoftc.sc_sigio, SIGIO, 0);
index bf2cfb5..9b7b321 100644 (file)
@@ -1435,52 +1435,3 @@ seltrue(cdev_t dev, int events)
 {
        return (events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM));
 }
-
-/*
- * Do a wakeup when a selectable event occurs.
- */
-void
-selwakeup(struct selinfo *sip)
-{
-       struct proc *p;
-       struct lwp *lp = NULL;
-
-       if (sip->si_pid == 0)
-               return;
-       if (sip->si_flags & SI_COLL) {
-               nselcoll++;
-               sip->si_flags &= ~SI_COLL;
-               wakeup((caddr_t)&selwait);      /* YYY fixable */
-       }
-       p = pfind(sip->si_pid);
-       sip->si_pid = 0;
-       if (p == NULL)
-               return;
-       lp = lwp_rb_tree_RB_LOOKUP(&p->p_lwp_tree, sip->si_tid);
-       if (lp == NULL)
-               return;
-
-       /*
-        * This is a temporary hack until the code can be rewritten.
-        * Check LWP_SELECT before assuming we can setrunnable().
-        * Otherwise we might catch the lwp before it actually goes to
-        * sleep.
-        */
-       crit_enter();
-       if (lp->lwp_flag & LWP_SELECT) {
-               lp->lwp_flag &= ~LWP_SELECT;
-       } else if (lp->lwp_wchan == (caddr_t)&selwait) {
-               /*
-                * Flag the process to break the tsleep when
-                * setrunnable is called, but only call setrunnable
-                * here if the process is not in a stopped state.
-                */
-               lp->lwp_flag |= LWP_BREAKTSLEEP;
-               if (p->p_stat != SSTOP)
-                       setrunnable(lp);
-       }
-       crit_exit();
-
-       kqueue_wakeup(&lp->lwp_kqueue);
-}
-
index 61da303..bcbd3f3 100644 (file)
@@ -637,7 +637,6 @@ mq_receive1(struct lwp *l, mqd_t mqdes, void *msg_ptr, size_t msg_len,
 
        /* Ready for sending now */
        get_mplock();
-       selwakeup(&mq->mq_wsel);
        KNOTE(&mq->mq_wsel.si_note, 0);
        rel_mplock();
 error:
@@ -829,7 +828,6 @@ mq_send1(struct lwp *l, mqd_t mqdes, const char *msg_ptr, size_t msg_len,
 
        /* Ready for receiving now */
        get_mplock();
-       selwakeup(&mq->mq_rsel);
        KNOTE(&mq->mq_rsel.si_note, 0);
        rel_mplock();
 error:
@@ -1055,8 +1053,6 @@ sys_mq_unlink(struct mq_unlink_args *uap)
        wakeup(&mq->mq_recv_cv);
 
        get_mplock();
-       selwakeup(&mq->mq_rsel);
-       selwakeup(&mq->mq_wsel);
        KNOTE(&mq->mq_rsel.si_note, 0);
        KNOTE(&mq->mq_wsel.si_note, 0);
        rel_mplock();
index a855f7f..b185d66 100644 (file)
@@ -170,12 +170,6 @@ pipeseltest(struct pipe *cpipe)
 static __inline void
 pipeselwakeup(struct pipe *cpipe)
 {
-       if (cpipe->pipe_state & PIPE_SEL) {
-               get_mplock();
-               cpipe->pipe_state &= ~PIPE_SEL;
-               selwakeup(&cpipe->pipe_sel);
-               rel_mplock();
-       }
        if ((cpipe->pipe_state & PIPE_ASYNC) && cpipe->pipe_sigio) {
                get_mplock();
                pgsigio(cpipe->pipe_sigio, SIGIO, 0);
index 0c8efa3..5817a35 100644 (file)
@@ -2215,8 +2215,6 @@ void
 ttwakeup(struct tty *tp)
 {
 
-       if (tp->t_rsel.si_pid != 0)
-               selwakeup(&tp->t_rsel);
        if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL)
                pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL));
        wakeup(TSA_HUP_OR_INPUT(tp));
@@ -2230,8 +2228,6 @@ void
 ttwwakeup(struct tty *tp)
 {
 
-       if (tp->t_wsel.si_pid != 0 && tp->t_outq.c_cc <= tp->t_olowat)
-               selwakeup(&tp->t_wsel);
        if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL)
                pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL));
        if (ISSET(tp->t_state, TS_BUSY | TS_SO_OCOMPLETE) ==
index 788f38a..0f2544f 100644 (file)
@@ -435,15 +435,11 @@ ptsstart(struct tty *tp)
 static void
 ptcwakeup(struct tty *tp, int flag)
 {
-       struct pt_ioctl *pti = tp->t_dev->si_drv1;
-
        if (flag & FREAD) {
-               selwakeup(&pti->pt_selr);
                wakeup(TSA_PTC_READ(tp));
                KNOTE(&tp->t_rsel.si_note, 0);
        }
        if (flag & FWRITE) {
-               selwakeup(&pti->pt_selw);
                wakeup(TSA_PTC_WRITE(tp));
                KNOTE(&tp->t_wsel.si_note, 0);
        }
index 85e3bee..af7809e 100644 (file)
@@ -1698,7 +1698,6 @@ sohasoutofband(struct socket *so)
 {
        if (so->so_sigio != NULL)
                pgsigio(so->so_sigio, SIGURG, 0);
-       selwakeup(&so->so_rcv.ssb_sel);
        KNOTE(&so->so_rcv.ssb_sel.si_note, NOTE_OOB);
 }
 
index 74aadf8..ce049c8 100644 (file)
@@ -336,8 +336,6 @@ sowakeup(struct socket *so, struct signalsockbuf *ssb)
 {
        struct selinfo *selinfo = &ssb->ssb_sel;
 
-       selwakeup(selinfo);
-       ssb->ssb_flags &= ~SSB_SEL;
        if (ssb->ssb_flags & SSB_WAIT) {
                if ((ssb == &so->so_snd && ssb_space(ssb) >= ssb->ssb_lowat) ||
                    (ssb == &so->so_rcv && ssb->ssb_cc >= ssb->ssb_lowat) ||
index e5ba0fa..461ab49 100644 (file)
@@ -521,11 +521,8 @@ bpf_wakeup(struct bpf_d *d)
                pgsigio(d->bd_sigio, d->bd_sig, 0);
 
        get_mplock();
-       selwakeup(&d->bd_sel);
        KNOTE(&d->bd_sel.si_note, 0);
        rel_mplock();
-       /* XXX */
-       d->bd_sel.si_pid = 0;
 }
 
 static void
index 7a3956b..0df418c 100644 (file)
@@ -812,7 +812,6 @@ rbch_rx_data_rdy(int unit)
        {
                NDBGL4(L4_RBCHDBG, "unit %d, NO wakeup", unit);
        }
-       selwakeup(&rbch_softc[unit].selp);
        KNOTE(&rbch_softc[unit].selp.si_note, 0);
 }
 
@@ -834,7 +833,6 @@ rbch_tx_queue_empty(int unit)
        {
                NDBGL4(L4_RBCHDBG, "unit %d, NO wakeup", unit);
        }
-       selwakeup(&rbch_softc[unit].selp);
        KNOTE(&rbch_softc[unit].selp.si_note, 0);
 }
 
@@ -847,7 +845,6 @@ rbch_activity(int unit, int rxtx)
 {
        if (rbch_softc[unit].sc_cd)
                rbch_softc[unit].sc_cd->last_active_time = SECOND;
-       selwakeup(&rbch_softc[unit].selp);
        KNOTE(&rbch_softc[unit].selp.si_note, 0);
 }
 
index 7b276d5..3a07253 100644 (file)
@@ -853,7 +853,6 @@ tel_connect(int unit, void *cdp)
                        sc->devstate &= ~ST_RDWAITDATA;
                        wakeup((caddr_t) &sc->result);
                }
-               selwakeup(&sc->selp);
                KNOTE(&sc->selp.si_note, 0);
        }
 }
@@ -897,7 +896,6 @@ tel_disconnect(int unit, void *cdp)
                        sc->devstate &= ~ST_RDWAITDATA;
                        wakeup((caddr_t) &sc->result);
                }
-               selwakeup(&sc->selp);
                KNOTE(&sc->selp.si_note, 0);
 
                if (sc->devstate & ST_TONE) {
@@ -926,7 +924,6 @@ tel_dialresponse(int unit, int status, cause_t cause)
                        sc->devstate &= ~ST_RDWAITDATA;
                        wakeup((caddr_t) &sc->result);
                }
-               selwakeup(&sc->selp);
                KNOTE(&sc->selp.si_note, 0);
        }
 }
@@ -954,7 +951,6 @@ tel_rx_data_rdy(int unit)
                sc->devstate &= ~ST_RDWAITDATA;
                wakeup((caddr_t) &sc->isdn_linktab->rx_queue);
        }
-       selwakeup(&sc->selp);
        KNOTE(&sc->selp.si_note, 0);
 }
 
@@ -976,7 +972,6 @@ tel_tx_queue_empty(int unit)
        if(sc->devstate & ST_TONE) {
                tel_tone(sc);
        } else {
-               selwakeup(&sc->selp);
                KNOTE(&sc->selp.si_note, 0);
        }
 }
index 6dbf67f..6e0e6a4 100644 (file)
@@ -829,7 +829,6 @@ i4bputqueue(struct mbuf *m)
                wakeup((caddr_t) &i4b_rdqueue);
        }
 
-       selwakeup(&select_rd_info);
        KNOTE(&select_rd_info.si_note, 0);
 }
 
@@ -865,7 +864,6 @@ i4bputqueue_hipri(struct mbuf *m)
                wakeup((caddr_t) &i4b_rdqueue);
        }
 
-       selwakeup(&select_rd_info);
        KNOTE(&select_rd_info.si_note, 0);
 }
 
index 732c64d..e76e05c 100644 (file)
@@ -428,7 +428,6 @@ tapclose(struct dev_close_args *ap)
 
        funsetown(tp->tap_sigio);
        tp->tap_sigio = NULL;
-       selwakeup(&tp->tap_rsel);
        KNOTE(&tp->tap_rsel.si_note, 0);
 
        tp->tap_flags &= ~TAP_OPEN;
@@ -653,13 +652,6 @@ tapifstart(struct ifnet *ifp)
                        pgsigio(tp->tap_sigio, SIGIO, 0);
                        rel_mplock();
                }
-
-               /*
-                * selwakeup is not MPSAFE.  tapifstart is.
-                */
-               get_mplock();
-               selwakeup(&tp->tap_rsel);
-               rel_mplock();
        }
 
        ifp->if_flags &= ~IFF_OACTIVE;
index c72ad37..8c56085 100644 (file)
@@ -218,7 +218,6 @@ tunclose(struct dev_close_args *ap)
        if_purgeaddrs_nolink(ifp);
 
        funsetown(tp->tun_sigio);
-       selwakeup(&tp->tun_rsel);
        KNOTE(&tp->tun_rsel.si_note, 0);
 
        TUNDEBUG(ifp, "closed\n");
@@ -398,7 +397,6 @@ tunoutput_serialized(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
                get_mplock();
                if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio)
                        pgsigio(tp->tun_sigio, SIGIO, 0);
-               selwakeup(&tp->tun_rsel);
                KNOTE(&tp->tun_rsel.si_note, 0);
                rel_mplock();
        }
@@ -798,7 +796,6 @@ tunstart(struct ifnet *ifp)
                }
                if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio)
                        pgsigio(tp->tun_sigio, SIGIO, 0);
-               selwakeup(&tp->tun_rsel);
                KNOTE(&tp->tun_rsel.si_note, 0);
        }
 }
index 97775b2..8134851 100644 (file)
@@ -904,7 +904,6 @@ apm_record_event(struct apm_softc *sc, u_int event_type)
        sc->event_ptr %= APM_NEVENTS;
        evp->type = event_type;
        evp->index = ++apm_evindex;
-       selwakeup(&sc->sc_rsel);
        KNOTE(&sc->sc_rsel.si_note, 0);
        return (sc->sc_flags & SCFLAG_OCTL) ? 0 : 1; /* user may handle */
 }
index b65f6fa..c2f6866 100644 (file)
@@ -520,11 +520,6 @@ ascintr(void *arg)
        if (scu->sbuf.size - scu->sbuf.count >= scu->linesize) {
            dma_restart(scu);
        }
-       if (scu->selp.si_pid) {
-           selwakeup(&scu->selp);
-           scu->selp.si_pid=(pid_t)0;
-           scu->selp.si_flags = 0;
-       }
        KNOTE(&scu->selp.si_note, 0);
     }
 }
index 5f80cca..d6e1501 100644 (file)
@@ -904,7 +904,6 @@ apm_record_event(struct apm_softc *sc, u_int event_type)
        sc->event_ptr %= APM_NEVENTS;
        evp->type = event_type;
        evp->index = ++apm_evindex;
-       selwakeup(&sc->sc_rsel);
        KNOTE(&sc->sc_rsel.si_note, 0);
        return (sc->sc_flags & SCFLAG_OCTL) ? 0 : 1; /* user may handle */
 }
index e8b3c11..cc5998c 100644 (file)
@@ -519,11 +519,6 @@ ascintr(void *arg)
        if (scu->sbuf.size - scu->sbuf.count >= scu->linesize) {
            dma_restart(scu);
        }
-       if (scu->selp.si_pid) {
-           selwakeup(&scu->selp);
-           scu->selp.si_pid=(pid_t)0;
-           scu->selp.si_flags = 0;
-       }
        KNOTE(&scu->selp.si_note, 0);
     }
 }
index 97bf833..b96256c 100644 (file)
@@ -67,7 +67,6 @@ struct kqueue {
        struct          klist *kq_knhash;       /* hash table for knotes */
 };
 
-#define KQ_SEL         0x01
 #define KQ_SLEEP       0x02
 #define KQ_ASYNC       0x04
 
index 0193f31..71d52a8 100644 (file)
@@ -59,10 +59,6 @@ struct selinfo {
 
 #define SEL_WAITING(sel)       (sel->si_pid != 0 || (sel->si_flags & SI_COLL) != 0)
 
-struct thread;
-
-void   selwakeup (struct selinfo *);
-
 #endif
 
 #endif /* !_SYS_SELINFO_H_ */
index d96c923..520c5b9 100644 (file)
@@ -76,7 +76,6 @@ struct signalsockbuf {
 #define        SSB_LOCK        0x01            /* lock on data queue */
 #define        SSB_WANT        0x02            /* someone is waiting to lock */
 #define        SSB_WAIT        0x04            /* someone is waiting for data/space */
-#define        SSB_SEL         0x08            /* someone is selecting */
 #define        SSB_ASYNC       0x10            /* ASYNC I/O, need signals */
 #define        SSB_UPCALL      0x20            /* someone wants an upcall */
 #define        SSB_NOINTR      0x40            /* operations not interruptible */
@@ -215,7 +214,7 @@ struct      xsocket {
  */
 #define        ssb_notify(ssb)                                 \
        (((ssb)->ssb_flags &                            \
-       (SSB_WAIT | SSB_SEL | SSB_ASYNC | SSB_UPCALL |  \
+       (SSB_WAIT | SSB_ASYNC | SSB_UPCALL |            \
        SSB_AIO | SSB_KNOTE | SSB_MEVENT)))
 
 /* do we have to send all at once on a socket? */