Lines Matching refs:knote

113 static int kqlock2knoteuse(struct kqueue *kq, struct knote *kn);
114 static int kqlock2knoteusewait(struct kqueue *kq, struct knote *kn);
115 static int kqlock2knotedrop(struct kqueue *kq, struct knote *kn);
116 static int knoteuse2kqlock(struct kqueue *kq, struct knote *kn);
128 static int kqueue_kqfilter(struct fileproc *fp, struct knote *kn,
162 static int knote_process(struct knote *kn, kevent_callback_t callback,
164 static void knote_put(struct knote *kn);
165 static int knote_fdpattach(struct knote *kn, struct filedesc *fdp,
167 static void knote_drop(struct knote *kn, struct proc *p);
168 static void knote_activate(struct knote *kn, int);
169 static void knote_deactivate(struct knote *kn);
170 static void knote_enqueue(struct knote *kn);
171 static void knote_dequeue(struct knote *kn);
172 static struct knote *knote_alloc(void);
173 static void knote_free(struct knote *kn);
175 static int filt_fileattach(struct knote *kn);
181 static void filt_kqdetach(struct knote *kn);
182 static int filt_kqueue(struct knote *kn, long hint);
190 static int filt_badattach(struct knote *kn);
195 static int filt_procattach(struct knote *kn);
196 static void filt_procdetach(struct knote *kn);
197 static int filt_proc(struct knote *kn, long hint);
205 static int filt_vmattach(struct knote *kn);
206 static void filt_vmdetach(struct knote *kn);
207 static int filt_vm(struct knote *kn, long hint);
224 static int filt_timerattach(struct knote *kn);
225 static void filt_timerdetach(struct knote *kn);
226 static int filt_timer(struct knote *kn, long hint);
227 static void filt_timertouch(struct knote *kn, struct kevent64_s *kev,
238 static int filt_timervalidate(struct knote *kn);
239 static void filt_timerupdate(struct knote *kn);
240 static void filt_timercancel(struct knote *kn);
261 static int filt_userattach(struct knote *kn);
262 static void filt_userdetach(struct knote *kn);
263 static int filt_user(struct knote *kn, long hint);
264 static void filt_usertouch(struct knote *kn, struct kevent64_s *kev,
309 * Most of the knote state is guarded by the object lock.
310 * the knote "inuse" count and status use the kqueue lock.
329 * Convert a kq lock to a knote use referece.
331 * If the knote is being dropped, we can't get
338 kqlock2knoteuse(struct kqueue *kq, struct knote *kn)
348 * Convert a kq lock to a knote use referece,
351 * If the knote is being dropped, we can't get
358 kqlock2knoteusewait(struct kqueue *kq, struct knote *kn)
374 * Convert from a knote use reference back to kq lock.
379 * The exit return indicates if the knote is
384 knoteuse2kqlock(struct kqueue *kq, struct knote *kn)
401 * Convert a kq lock to a knote drop reference.
403 * If the knote is in use, wait for the use count
415 kqlock2knotedrop(struct kqueue *kq, struct knote *kn)
436 * Release a knote use count reference.
439 knote_put(struct knote *kn)
455 filt_fileattach(struct knote *kn)
468 filt_kqdetach(struct knote *kn)
479 filt_kqueue(struct knote *kn, __unused long hint)
488 filt_procattach(struct knote *kn)
534 * The knote may be attached to a different process, which may exit,
535 * leaving nothing for the knote to be attached to. In that case,
539 filt_procdetach(struct knote *kn)
555 filt_proc(struct knote *kn, long hint)
558 * Note: a lot of bits in hint may be obtained from the knote
585 * This knote is not for the current ptrace(2) parent, ignore.
662 filt_vmattach(struct knote *kn)
673 filt_vmdetach(struct knote *kn)
679 filt_vm(struct knote *kn, long hint)
699 * The saved-data field in the knote contains the
714 filt_timervalidate(struct knote *kn)
783 filt_timerupdate(struct knote *kn)
808 * Just propagate the timer event into the knote
809 * filter routine (by going through the knote
818 struct knote *kn = knx;
844 filt_timercancel(struct knote *kn)
869 * Allocate a thread call for the knote's lifetime, and kick off the timer.
872 filt_timerattach(struct knote *kn)
926 filt_timerdetach(struct knote *kn)
943 filt_timer(struct knote *kn, long hint)
993 * filt_timertouch - update knote with new user input
996 * the user picks up a knote, clear the count of how many timer
1000 filt_timertouch(struct knote *kn, struct kevent64_s *kev, long type)
1018 /* no way to report error, so mark it in the knote */
1079 filt_userattach(struct knote *kn)
1092 filt_userdetach(__unused struct knote *kn)
1098 filt_user(struct knote *kn, __unused long hint)
1104 filt_usertouch(struct knote *kn, struct kevent64_s *kev, long type)
1150 filt_badattach(__unused struct knote *kn)
1208 struct knote *kn;
1623 * the kqueue via a knote data structure.
1626 * descriptor related, the knote is linked off
1641 struct knote *kn = NULL;
1690 * kn now contains the matching knote, or NULL if no match
1725 * apply reference count to knote structure, and
1763 /* existing knote - get kqueue lock */
1777 /* update status flags for existing knote */
1800 * knote - go find/insert a new one. But we have
1803 * knote. Wait for those to complete as well and
1818 /* still have use ref on knote */
1821 * If the knote is not marked to always stay enqueued,
1845 * a use reference on the knote to avoid it being detached.
1854 knote_process(struct knote *kn,
1911 * convert back to a kqlock - bail if the knote
1948 /* move knote onto inprocess queue */
1955 * Determine how to dispatch the knote for future event handling.
2053 * the knote to avoid it being detached. For each event
2070 struct knote *kn;
2312 struct knote *kn;
2347 * KN_STAYQUEUED knote, which may or may not have
2352 while ((kn = (struct knote *)TAILQ_FIRST(&kq->kq_head)) != NULL) {
2411 kqueue_kqfilter(__unused struct fileproc *fp, struct knote *kn, __unused vfs_context_t ctx)
2522 * Query/Post each knote in the object's list
2534 knote(struct klist *list, long hint)
2536 struct knote *kn;
2558 * attach a knote to the specified list. Return true if this is the first entry.
2562 knote_attach(struct klist *list, struct knote *kn)
2570 * detach a knote from the specified list. Return true if that was the last entry.
2574 knote_detach(struct klist *list, struct knote *kn)
2576 SLIST_REMOVE(list, kn, knote, kn_selnext);
2581 * For a given knote, link a provided wait queue directly with the kqueue.
2583 * the knote to the active list at wakeup (nothing calls knote()). Instead,
2586 * kqueue and knote references are held by caller.
2591 knote_link_wait_queue(struct knote *kn, struct wait_queue *wq, wait_queue_link_t wql)
2606 * Unlink the provided wait queue from the kqueue associated with a knote.
2615 knote_unlink_wait_queue(struct knote *kn, struct wait_queue *wq, wait_queue_link_t *wqlp)
2642 struct knote *kn;
2676 knote_fdpattach(struct knote *kn, struct filedesc *fdp, struct proc *p)
2728 knote_drop(struct knote *kn, __unused struct proc *ctxp)
2742 SLIST_REMOVE(list, kn, knote, kn_link);
2761 knote_activate(struct knote *kn, int propagate)
2776 knote_deactivate(struct knote *kn)
2784 knote_enqueue(struct knote *kn)
2799 knote_dequeue(struct knote *kn)
2816 knote_zone = zinit(sizeof(struct knote), 8192*sizeof(struct knote),
2817 8192, "knote zone");
2840 SYSINIT(knote, SI_SUB_PSEUDO, SI_ORDER_ANY, knote_init, NULL)
2842 static struct knote *
2845 return ((struct knote *)zalloc(knote_zone));
2849 knote_free(struct knote *kn)
3331 knote_markstayqueued(struct knote *kn)