Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Move klist_{init,fini,insert,remove}() into kern_event.c...
details: https://anonhg.NetBSD.org/src/rev/34e2cfc88c93
branches: trunk
changeset: 368464:34e2cfc88c93
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Jul 13 14:11:46 2022 +0000
description:
Move klist_{init,fini,insert,remove}() into kern_event.c. NFC.
diffstat:
sys/kern/kern_event.c | 42 ++++++++++++++++++++++++++++++++++++++++--
sys/sys/event.h | 30 +++++-------------------------
2 files changed, 45 insertions(+), 27 deletions(-)
diffs (104 lines):
diff -r 60016d17818c -r 34e2cfc88c93 sys/kern/kern_event.c
--- a/sys/kern/kern_event.c Wed Jul 13 03:23:07 2022 +0000
+++ b/sys/kern/kern_event.c Wed Jul 13 14:11:46 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_event.c,v 1.142 2022/07/13 03:23:07 thorpej Exp $ */
+/* $NetBSD: kern_event.c,v 1.143 2022/07/13 14:11:46 thorpej Exp $ */
/*-
* Copyright (c) 2008, 2009, 2021 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
#endif /* _KERNEL_OPT */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.142 2022/07/13 03:23:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.143 2022/07/13 14:11:46 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2813,3 +2813,41 @@
kn->kn_flags &= ~EV_EOF;
mutex_spin_exit(&kq->kq_lock);
}
+
+/*
+ * Initialize a klist.
+ */
+void
+klist_init(struct klist *list)
+{
+ SLIST_INIT(list);
+}
+
+/*
+ * Finalize a klist.
+ */
+void
+klist_fini(struct klist *list)
+{
+ /* Nothing, for now. */
+}
+
+/*
+ * Insert a knote into a klist.
+ */
+void
+klist_insert(struct klist *list, struct knote *kn)
+{
+ SLIST_INSERT_HEAD(list, kn, kn_selnext);
+}
+
+/*
+ * Remove a knote from a klist. Returns true if the last
+ * knote was removed and the list is now empty.
+ */
+bool
+klist_remove(struct klist *list, struct knote *kn)
+{
+ SLIST_REMOVE(list, kn, knote, kn_selnext);
+ return SLIST_EMPTY(list);
+}
diff -r 60016d17818c -r 34e2cfc88c93 sys/sys/event.h
--- a/sys/sys/event.h Wed Jul 13 03:23:07 2022 +0000
+++ b/sys/sys/event.h Wed Jul 13 14:11:46 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: event.h,v 1.52 2022/02/12 15:51:29 thorpej Exp $ */
+/* $NetBSD: event.h,v 1.53 2022/07/13 14:11:46 thorpej Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon%FreeBSD.org@localhost>
@@ -334,30 +334,10 @@
int filt_seltrue(struct knote *, long);
extern const struct filterops seltrue_filtops;
-static inline void
-klist_init(struct klist *list)
-{
- SLIST_INIT(list);
-}
-
-static inline void
-klist_fini(struct klist *list)
-{
- /* Nothing, for now. */
-}
-
-static inline void
-klist_insert(struct klist *list, struct knote *kn)
-{
- SLIST_INSERT_HEAD(list, kn, kn_selnext);
-}
-
-static inline bool
-klist_remove(struct klist *list, struct knote *kn)
-{
- SLIST_REMOVE(list, kn, knote, kn_selnext);
- return SLIST_EMPTY(list);
-}
+void klist_init(struct klist *);
+void klist_fini(struct klist *);
+void klist_insert(struct klist *, struct knote *);
+bool klist_remove(struct klist *, struct knote *);
#else /* !_KERNEL */
Home |
Main Index |
Thread Index |
Old Index