summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/tw.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-09-14 03:19:42 +0000
committerpeter <peter@FreeBSD.org>1997-09-14 03:19:42 +0000
commit796eb5ce0afbb92f7c829367cc09ec04472e0166 (patch)
tree0720cfdb6d407dea01c6b7bc049ac3afa3cc5020 /sys/i386/isa/tw.c
parente762286917ce1de5d1fc3744a413be43a74c656b (diff)
downloadFreeBSD-src-796eb5ce0afbb92f7c829367cc09ec04472e0166.zip
FreeBSD-src-796eb5ce0afbb92f7c829367cc09ec04472e0166.tar.gz
Update select -> poll in drivers.
Diffstat (limited to 'sys/i386/isa/tw.c')
-rw-r--r--sys/i386/isa/tw.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c
index 2673a14..6c08fae 100644
--- a/sys/i386/isa/tw.c
+++ b/sys/i386/isa/tw.c
@@ -145,6 +145,7 @@
#include <sys/uio.h>
#include <sys/syslog.h>
#include <sys/select.h>
+#include <sys/poll.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /*DEVFS*/
@@ -215,13 +216,13 @@ static d_open_t twopen;
static d_close_t twclose;
static d_read_t twread;
static d_write_t twwrite;
-static d_select_t twselect;
+static d_poll_t twpoll;
#define CDEV_MAJOR 19
static struct cdevsw tw_cdevsw =
{ twopen, twclose, twread, twwrite, /*19*/
noioc, nullstop, nullreset, nodevtotty, /* tw */
- twselect, nommap, nostrat, "tw", NULL, -1 };
+ twpoll, nommap, nostrat, "tw", NULL, -1 };
/*
* Software control structure for TW523
@@ -526,24 +527,26 @@ int twwrite(dev, uio, ioflag)
* Determine if there is data available for reading
*/
-int twselect(dev, rw, p)
+int twpoll(dev, events, p)
dev_t dev;
- int rw;
+ int events;
struct proc *p;
{
struct tw_sc *sc;
- struct proc *pp;
- int s, i;
+ int s;
+ int revents = 0;
sc = &tw_sc[TWUNIT(dev)];
s = spltty();
- if(sc->sc_nextin != sc->sc_nextout) {
- splx(s);
- return(1);
- }
- selrecord(p, &sc->sc_selp);
+ /* XXX is this correct? the original code didn't test select rw mode!! */
+ if (events & (POLLIN | POLLRDNORM))
+ if(sc->sc_nextin != sc->sc_nextout)
+ revents |= events & (POLLIN | POLLRDNORM);
+ else
+ selrecord(p, &sc->sc_selp);
+
splx(s);
- return(0);
+ return(revents);
}
/*
OpenPOWER on IntegriCloud