diff options
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r-- | sys/arch/hp300/dev/grf.c | 11 | ||||
-rw-r--r-- | sys/arch/hp300/dev/hil.c | 36 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/conf.c | 12 |
3 files changed, 30 insertions, 29 deletions
diff --git a/sys/arch/hp300/dev/grf.c b/sys/arch/hp300/dev/grf.c index 8f4cc5709db..eb204fd152d 100644 --- a/sys/arch/hp300/dev/grf.c +++ b/sys/arch/hp300/dev/grf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf.c,v 1.22 2003/06/02 23:27:44 millert Exp $ */ +/* $OpenBSD: grf.c,v 1.23 2003/09/23 16:51:11 millert Exp $ */ /* $NetBSD: grf.c,v 1.30 1998/08/20 08:33:41 kleink Exp $ */ /* @@ -53,6 +53,7 @@ #include <sys/ioctl.h> #include <sys/malloc.h> #include <sys/mman.h> +#include <sys/poll.h> #include <sys/proc.h> #include <sys/resourcevar.h> #include <sys/vnode.h> @@ -284,14 +285,12 @@ grfioctl(dev, cmd, data, flag, p) /*ARGSUSED*/ int -grfselect(dev, rw, p) +grfpoll(dev, events, p) dev_t dev; - int rw; + int events; struct proc *p; { - if (rw == FREAD) - return(0); - return(1); + return (events & (POLLOUT | POLLWRNORM)); } /*ARGSUSED*/ diff --git a/sys/arch/hp300/dev/hil.c b/sys/arch/hp300/dev/hil.c index 0785e4f08bb..2403c8f30d5 100644 --- a/sys/arch/hp300/dev/hil.c +++ b/sys/arch/hp300/dev/hil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hil.c,v 1.18 2003/06/02 23:27:44 millert Exp $ */ +/* $OpenBSD: hil.c,v 1.19 2003/09/23 16:51:11 millert Exp $ */ /* $NetBSD: hil.c,v 1.34 1997/04/02 22:37:32 scottr Exp $ */ /* @@ -46,6 +46,7 @@ #include <sys/file.h> #include <sys/ioctl.h> #include <sys/kernel.h> +#include <sys/poll.h> #include <sys/proc.h> #include <sys/tty.h> #include <sys/uio.h> @@ -735,19 +736,21 @@ hilmmap(dev, off, prot) /*ARGSUSED*/ int -hilselect(dev, rw, p) +hilpoll(dev, events, p) dev_t dev; - int rw; + int events; struct proc *p; { struct hil_softc *hilp = &hil_softc[HILLOOP(dev)]; struct hilloopdev *dptr; struct hiliqueue *qp; int mask; - int s, device; + int s, revents, device; + + revents = events & (POLLOUT | POLLWRNORM); + if (events & (POLLIN | POLLRDNORM) == 0) + return (revents); - if (rw == FWRITE) - return (1); device = HILUNIT(dev); /* @@ -757,13 +760,12 @@ hilselect(dev, rw, p) dptr = &hilp->hl_device[device]; if (dptr->hd_flags & HIL_READIN) { s = splhil(); - if (dptr->hd_queue.c_cc) { - splx(s); - return (1); - } - selrecord(p, &dptr->hd_selr); + if (dptr->hd_queue.c_cc) + revents |= events & (POLLIN | POLLRDNORM); + else + selrecord(p, &dptr->hd_selr); splx(s); - return (0); + return (revents); } /* @@ -772,7 +774,7 @@ hilselect(dev, rw, p) * This is primarily to be consistant with HP-UX. */ if (device && (dptr->hd_flags & (HIL_ALIVE|HIL_PSEUDO)) != HIL_ALIVE) - return (1); + return (revents | (events & (POLLIN | POLLRDNORM))); /* * Select on loop device is special. @@ -792,12 +794,12 @@ hilselect(dev, rw, p) qp->hq_eventqueue->hil_evqueue.head != qp->hq_eventqueue->hil_evqueue.tail) { splx(s); - return (1); + return (revents | (events & (POLLIN | POLLRDNORM))); } selrecord(p, &dptr->hd_selr); splx(s); - return (0); + return (revents); } /*ARGSUSED*/ @@ -985,7 +987,7 @@ hilevent(hilp) } /* - * Wake up anyone selecting on this device or the loop itself + * Wake up anyone polling this device or the loop itself */ selwakeup(&dptr->hd_selr); dptr = &hilp->hl_device[HILLOOPDEV]; @@ -1026,7 +1028,7 @@ hpuxhilevent(hilp, dptr) } /* - * Wake up any one blocked on a read or select + * Wake up any one blocked on a read or poll */ if (dptr->hd_flags & HIL_ASLEEP) { dptr->hd_flags &= ~HIL_ASLEEP; diff --git a/sys/arch/hp300/hp300/conf.c b/sys/arch/hp300/hp300/conf.c index 92d6b952c7e..41b386845d1 100644 --- a/sys/arch/hp300/hp300/conf.c +++ b/sys/arch/hp300/hp300/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.33 2003/06/02 23:27:45 millert Exp $ */ +/* $OpenBSD: conf.c,v 1.34 2003/09/23 16:51:11 millert Exp $ */ /* $NetBSD: conf.c,v 1.39 1997/05/12 08:17:53 thorpej Exp $ */ /*- @@ -72,24 +72,24 @@ struct bdevsw bdevsw[] = }; int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]); -/* open, close, ioctl, select, mmap -- XXX should be a map device */ +/* open, close, ioctl, poll, mmap -- XXX should be a map device */ #define cdev_grf_init(c,n) { \ dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) nullop, \ (dev_type_write((*))) nullop, dev_init(c,n,ioctl), \ - (dev_type_stop((*))) enodev, 0, dev_init(c,n,select), \ + (dev_type_stop((*))) enodev, 0, dev_init(c,n,poll), \ dev_init(c,n,mmap) } /* open, close, read, write, ioctl -- XXX should be a generic device */ #define cdev_ppi_init(c,n) { \ dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) nullop, \ - 0, (dev_type_select((*))) enodev, (dev_type_mmap((*))) enodev } + 0, (dev_type_poll((*))) enodev, (dev_type_mmap((*))) enodev } -/* open, close, read, ioctl, select, mmap -- XXX should be a map device */ +/* open, close, read, ioctl, poll, mmap -- XXX should be a map device */ #define cdev_hil_init(c,n) { \ dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ (dev_type_write((*))) nullop, dev_init(c,n,ioctl), \ - (dev_type_stop((*))) enodev, 0, dev_init(c,n,select), \ + (dev_type_stop((*))) enodev, 0, dev_init(c,n,poll), \ dev_init(c,n,mmap) } #define mmread mmrw |