Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/kqueue]: src/sys prove kqfilter hook; it's very simple equivalent of sel...
details: https://anonhg.NetBSD.org/src/rev/d1468eadf90e
branches: kqueue
changeset: 512492:d1468eadf90e
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Fri Jun 28 07:50:41 2002 +0000
description:
prove kqfilter hook; it's very simple equivalent of seltrue()
diffstat:
sys/arch/sparc/dev/cgeight.c | 27 ++++++++++++++++++++++++++-
sys/arch/sparc/dev/cgfour.c | 27 ++++++++++++++++++++++++++-
sys/arch/sparc/dev/cgfourteen.c | 27 ++++++++++++++++++++++++++-
sys/arch/sparc/dev/cgtwo.c | 27 ++++++++++++++++++++++++++-
sys/dev/sbus/p9100.c | 29 +++++++++++++++++++++++++++--
sys/dev/sbus/tcx.c | 29 +++++++++++++++++++++++++++--
sys/dev/sun/bwtwo.c | 29 +++++++++++++++++++++++++++--
sys/dev/sun/cgsix.c | 29 +++++++++++++++++++++++++++--
sys/dev/sun/cgthree.c | 29 +++++++++++++++++++++++++++--
9 files changed, 239 insertions(+), 14 deletions(-)
diffs (truncated from 414 to 300 lines):
diff -r ff5c2935d036 -r d1468eadf90e sys/arch/sparc/dev/cgeight.c
--- a/sys/arch/sparc/dev/cgeight.c Fri Jun 28 07:27:38 2002 +0000
+++ b/sys/arch/sparc/dev/cgeight.c Fri Jun 28 07:50:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgeight.c,v 1.24.4.2 2002/03/16 15:59:45 jdolecek Exp $ */
+/* $NetBSD: cgeight.c,v 1.24.4.3 2002/06/28 07:50:41 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -403,6 +403,31 @@
return (seltrue(dev, events, p));
}
+static void
+filt_cgeightdetach(struct knote *kn)
+{
+ /* Nothing to do */
+}
+
+static const struct filterops cgeight_filtops =
+ { 1, NULL, filt_cgeightdetach, filt_seltrue };
+
+int
+cgeightkqfilter(dev_t dev, struct knote *kn)
+{
+ switch (kn->kn_filter) {
+ case EVFILT_READ:
+ case EVFILT_WRITE:
+ kn->kn_fop = &cgeight_filtops;
+ break;
+ default:
+ return (1);
+ }
+
+ /* Nothing more to do */
+ return (0);
+}
+
/*
* Return the address that would map the given device at the given
* offset, allowing for the given protection, or return -1 for error.
diff -r ff5c2935d036 -r d1468eadf90e sys/arch/sparc/dev/cgfour.c
--- a/sys/arch/sparc/dev/cgfour.c Fri Jun 28 07:27:38 2002 +0000
+++ b/sys/arch/sparc/dev/cgfour.c Fri Jun 28 07:50:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgfour.c,v 1.24.4.2 2002/03/16 15:59:45 jdolecek Exp $ */
+/* $NetBSD: cgfour.c,v 1.24.4.3 2002/06/28 07:50:42 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -400,6 +400,31 @@
return (seltrue(dev, events, p));
}
+static void
+filt_cgfourdetach(struct knote *kn)
+{
+ /* Nothing to do */
+}
+
+static const struct filterops cgfour_filtops =
+ { 1, NULL, filt_cgfourdetach, filt_seltrue };
+
+int
+cgfourkqfilter(dev_t dev, struct knote *kn)
+{
+ switch (kn->kn_filter) {
+ case EVFILT_READ:
+ case EVFILT_WRITE:
+ kn->kn_fop = &cgfour_filtops;
+ break;
+ default:
+ return (1);
+ }
+
+ /* Nothing more to do */
+ return (0);
+}
+
/*
* Return the address that would map the given device at the given
* offset, allowing for the given protection, or return -1 for error.
diff -r ff5c2935d036 -r d1468eadf90e sys/arch/sparc/dev/cgfourteen.c
--- a/sys/arch/sparc/dev/cgfourteen.c Fri Jun 28 07:27:38 2002 +0000
+++ b/sys/arch/sparc/dev/cgfourteen.c Fri Jun 28 07:50:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgfourteen.c,v 1.20.4.3 2002/06/23 17:41:43 jdolecek Exp $ */
+/* $NetBSD: cgfourteen.c,v 1.20.4.4 2002/06/28 07:50:43 jdolecek Exp $ */
/*
* Copyright (c) 1996
@@ -623,6 +623,31 @@
return (seltrue(dev, events, p));
}
+static void
+filt_cgfourteendetach(struct knote *kn)
+{
+ /* Nothing to do */
+}
+
+static const struct filterops cgfourteen_filtops =
+ { 1, NULL, filt_cgfourteendetach, filt_seltrue };
+
+int
+cgfourteenkqfilter(dev_t dev, struct knote *kn)
+{
+ switch (kn->kn_filter) {
+ case EVFILT_READ:
+ case EVFILT_WRITE:
+ kn->kn_fop = &cgfourteen_filtops;
+ break;
+ default:
+ return (1);
+ }
+
+ /* Nothing more to do */
+ return (0);
+}
+
/*
* Miscellaneous helper functions
*/
diff -r ff5c2935d036 -r d1468eadf90e sys/arch/sparc/dev/cgtwo.c
--- a/sys/arch/sparc/dev/cgtwo.c Fri Jun 28 07:27:38 2002 +0000
+++ b/sys/arch/sparc/dev/cgtwo.c Fri Jun 28 07:50:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgtwo.c,v 1.34.4.1 2001/08/25 06:15:51 thorpej Exp $ */
+/* $NetBSD: cgtwo.c,v 1.34.4.2 2002/06/28 07:50:44 jdolecek Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -302,6 +302,31 @@
return (seltrue(dev, events, p));
}
+static void
+filt_cgtwodetach(struct knote *kn)
+{
+ /* Nothing to do */
+}
+
+static const struct filterops cgtwo_filtops =
+ { 1, NULL, filt_cgtwodetach, filt_seltrue };
+
+int
+cgtwokqfilter(dev_t dev, struct knote *kn)
+{
+ switch (kn->kn_filter) {
+ case EVFILT_READ:
+ case EVFILT_WRITE:
+ kn->kn_fop = &cgtwo_filtops;
+ break;
+ default:
+ return (1);
+ }
+
+ /* Nothing more to do */
+ return (0);
+}
+
/*
* Undo the effect of an FBIOSVIDEO that turns the video off.
*/
diff -r ff5c2935d036 -r d1468eadf90e sys/dev/sbus/p9100.c
--- a/sys/dev/sbus/p9100.c Fri Jun 28 07:27:38 2002 +0000
+++ b/sys/dev/sbus/p9100.c Fri Jun 28 07:50:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: p9100.c,v 1.2.4.2 2002/03/16 16:01:30 jdolecek Exp $ */
+/* $NetBSD: p9100.c,v 1.2.4.3 2002/06/28 07:50:48 jdolecek Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.2.4.2 2002/03/16 16:01:30 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.2.4.3 2002/06/28 07:50:48 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -404,6 +404,31 @@
return seltrue(dev, events, p);
}
+static void
+filt_p9100detach(struct knote *kn)
+{
+ /* Nothing to do */
+}
+
+static const struct filterops p9100_filtops =
+ { 1, NULL, filt_p9100detach, filt_seltrue };
+
+int
+p9100kqfilter(dev_t dev, struct knote *kn)
+{
+ switch (kn->kn_filter) {
+ case EVFILT_READ:
+ case EVFILT_WRITE:
+ kn->kn_fop = &p9100_filtops;
+ break;
+ default:
+ return (1);
+ }
+
+ /* Nothing more to do */
+ return (0);
+}
+
static uint32_t
p9100_ctl_read_4(struct p9100_softc *sc, bus_size_t off)
{
diff -r ff5c2935d036 -r d1468eadf90e sys/dev/sbus/tcx.c
--- a/sys/dev/sbus/tcx.c Fri Jun 28 07:27:38 2002 +0000
+++ b/sys/dev/sbus/tcx.c Fri Jun 28 07:50:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcx.c,v 1.2.6.3 2002/06/23 17:48:42 jdolecek Exp $ */
+/* $NetBSD: tcx.c,v 1.2.6.4 2002/06/28 07:50:49 jdolecek Exp $ */
/*
* Copyright (c) 1996,1998 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.2.6.3 2002/06/23 17:48:42 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.2.6.4 2002/06/28 07:50:49 jdolecek Exp $");
/*
* define for cg8 emulation on S24 (24-bit version of tcx) for the SS5;
@@ -509,6 +509,31 @@
return (seltrue(dev, events, p));
}
+static void
+filt_tcxdetach(struct knote *kn)
+{
+ /* Nothing to do */
+}
+
+static const struct filterops tcx_filtops =
+ { 1, NULL, filt_tcxdetach, filt_seltrue };
+
+int
+tcxkqfilter(dev_t dev, struct knote *kn)
+{
+ switch (kn->kn_filter) {
+ case EVFILT_READ:
+ case EVFILT_WRITE:
+ kn->kn_fop = &tcx_filtops;
+ break;
+ default:
+ return (1);
+ }
+
+ /* Nothing more to do */
+ return (0);
+}
+
/*
* Clean up hardware state (e.g., after bootup or after X crashes).
*/
diff -r ff5c2935d036 -r d1468eadf90e sys/dev/sun/bwtwo.c
--- a/sys/dev/sun/bwtwo.c Fri Jun 28 07:27:38 2002 +0000
+++ b/sys/dev/sun/bwtwo.c Fri Jun 28 07:50:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bwtwo.c,v 1.2.6.1 2002/01/10 19:58:31 thorpej Exp $ */
+/* $NetBSD: bwtwo.c,v 1.2.6.2 2002/06/28 07:50:46 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.2.6.1 2002/01/10 19:58:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.2.6.2 2002/06/28 07:50:46 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -285,6 +285,31 @@
return (seltrue(dev, events, p));
}
+static void
+filt_bwtwodetach(struct knote *kn)
+{
+ /* Nothing to do */
+}
+
+static const struct filterops bwtwo_filtops =
+ { 1, NULL, filt_bwtwodetach, filt_seltrue };
+
+int
+bwtwokqfilter(dev_t dev, struct knote *kn)
+{
+ switch (kn->kn_filter) {
+ case EVFILT_READ:
Home |
Main Index |
Thread Index |
Old Index