Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 1996 20:23:27 +1030 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        hackers@freebsd.org
Subject:   care and feeding of selwakeup() ?
Message-ID:  <199602140953.UAA16773@genesis.atrad.adelaide.edu.au>

next in thread | raw e-mail | index | archive | help

Hiho all you device-driver people again; yet another question to bore you
senseless.  (Eric, are you keeping track of all these answers? 8)

I have a device select function that (appears) to be happily registering
a selector on my device (only one, but that's fine). eg:

    if (rw == FREAD)			/* selecting to read */
    {
	if (rxbuflen(md))		/* data available to read */
	{
	    splx(s);
	    return(1);
	}
	selrecord(p,&(md->rsel));
	splx(s);
	return(0);
    }

I can tracewrite and see that this is called OK, and the process selecting
waits on 'select', so all appears OK there.  

Now my interrupt handler comes along, receives some data and wants to 
kick any selector into action :

    if (readsome)			/* anything in? */
    {
	debug("kick read selector (pid %d)",md->rsel.si_pid);
	selwakeup(&md->rsel);
	md->rsel.si_pid = 0;
	md->rsel.si_flags = 0;
	...
    }

But select in the reader never comes back (though the pid's match).

Any magic ideas?  I'm stumped...

-- 
]] Mike Smith, Software Engineer        msmith@atrad.adelaide.edu.au    [[
]] Genesis Software                     genesis@atrad.adelaide.edu.au   [[
]] High-speed data acquisition and      (GSM mobile) 0411-222-496       [[
]] realtime instrument control          (ph/fax)  +61-8-267-3039        [[
]] Collector of old Unix hardware.      "I seek PEZ!" - The Tick        [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602140953.UAA16773>