Lines Matching refs:knote

108 static int	kqlock2knoteuse(struct kqueue *kq, struct knote *kn);
109 static int kqlock2knoteusewait(struct kqueue *kq, struct knote *kn);
110 static int kqlock2knotedrop(struct kqueue *kq, struct knote *kn);
111 static int knoteuse2kqlock(struct kqueue *kq, struct knote *kn);
123 static int kqueue_kqfilter(struct fileproc *fp, struct knote *kn, vfs_context_t ctx);
151 static int knote_process(struct knote *kn, kevent_callback_t callback,
153 static void knote_put(struct knote *kn);
154 static int knote_fdpattach(struct knote *kn, struct filedesc *fdp, struct proc *p);
155 static void knote_drop(struct knote *kn, struct proc *p);
156 static void knote_activate(struct knote *kn, int);
157 static void knote_deactivate(struct knote *kn);
158 static void knote_enqueue(struct knote *kn);
159 static void knote_dequeue(struct knote *kn);
160 static struct knote *knote_alloc(void);
161 static void knote_free(struct knote *kn);
163 static int filt_fileattach(struct knote *kn);
169 static void filt_kqdetach(struct knote *kn);
170 static int filt_kqueue(struct knote *kn, long hint);
180 static int filt_badattach(struct knote *kn);
185 static int filt_procattach(struct knote *kn);
186 static void filt_procdetach(struct knote *kn);
187 static int filt_proc(struct knote *kn, long hint);
195 static int filt_vmattach(struct knote *kn);
196 static void filt_vmdetach(struct knote *kn);
197 static int filt_vm(struct knote *kn, long hint);
210 static int filt_timerattach(struct knote *kn);
211 static void filt_timerdetach(struct knote *kn);
212 static int filt_timer(struct knote *kn, long hint);
213 static void filt_timertouch(struct knote *kn, struct kevent64_s *kev,
225 static int filt_timervalidate(struct knote *kn);
226 static void filt_timerupdate(struct knote *kn);
227 static void filt_timercancel(struct knote *kn);
248 static int filt_userattach(struct knote *kn);
249 static void filt_userdetach(struct knote *kn);
250 static int filt_user(struct knote *kn, long hint);
251 static void filt_usertouch(struct knote *kn, struct kevent64_s *kev,
291 * Most of the knote state is guarded by the object lock.
292 * the knote "inuse" count and status use the kqueue lock.
311 * Convert a kq lock to a knote use referece.
313 * If the knote is being dropped, we can't get
321 kqlock2knoteuse(struct kqueue *kq, struct knote *kn)
331 * Convert a kq lock to a knote use referece,
334 * If the knote is being dropped, we can't get
342 kqlock2knoteusewait(struct kqueue *kq, struct knote *kn)
358 * Convert from a knote use reference back to kq lock.
363 * The exit return indicates if the knote is
368 knoteuse2kqlock(struct kqueue *kq, struct knote *kn)
384 * Convert a kq lock to a knote drop referece.
386 * If the knote is in use, wait for the use count
398 kqlock2knotedrop(struct kqueue *kq, struct knote *kn)
418 * Release a knote use count reference.
421 knote_put(struct knote *kn)
436 filt_fileattach(struct knote *kn)
451 filt_kqdetach(struct knote *kn)
462 filt_kqueue(struct knote *kn, __unused long hint)
471 filt_procattach(struct knote *kn)
517 * The knote may be attached to a different process, which may exit,
518 * leaving nothing for the knote to be attached to. In that case,
522 filt_procdetach(struct knote *kn)
538 filt_proc(struct knote *kn, long hint)
563 * This knote is not for the current ptrace(2) parent, ignore.
608 filt_vmattach(struct knote *kn)
620 filt_vmdetach(struct knote *kn)
626 filt_vm(struct knote *kn, long hint)
645 * The saved-data field in the knote contains the
660 filt_timervalidate(struct knote *kn)
723 filt_timerupdate(struct knote *kn)
748 * Just propagate the timer event into the knote
749 * filter routine (by going through the knote
758 struct knote *kn = knx;
784 filt_timercancel(struct knote *kn)
809 * Allocate a thread call for the knote's lifetime, and kick off the timer.
812 filt_timerattach(struct knote *kn)
853 filt_timerdetach(struct knote *kn)
870 filt_timer(struct knote *kn, long hint)
907 * filt_timertouch - update knote with new user input
910 * the user picks up a knote, clear the count of how many timer
914 filt_timertouch(struct knote *kn, struct kevent64_s *kev, long type)
930 /* no way to report error, so mark it in the knote */
977 filt_userattach(struct knote *kn)
990 filt_userdetach(__unused struct knote *kn)
996 filt_user(struct knote *kn, __unused long hint)
1002 filt_usertouch(struct knote *kn, struct kevent64_s *kev, long type)
1048 filt_badattach(__unused struct knote *kn)
1106 struct knote *kn;
1511 * the kqueue via a knote data structure.
1514 * descriptor related, the knote is linked off
1528 struct knote *kn = NULL;
1577 * kn now contains the matching knote, or NULL if no match
1612 * apply reference count to knote structure, and
1650 /* existing knote - get kqueue lock */
1664 /* update status flags for existing knote */
1687 * knote - go find/insert a new one. But we have
1690 * knote. Wait for those to complete as well and
1705 /* still have use ref on knote */
1708 * If the knote is not marked to always stay enqueued,
1732 * a use reference on the knote to avoid it being detached.
1741 knote_process(struct knote *kn,
1794 /* convert back to a kqlock - bail if the knote went away */
1820 /* move knote onto inprocess queue */
1827 * Determine how to dispatch the knote for future event handling.
1923 * the knote to avoid it being detached. For each event
1940 struct knote *kn;
2177 struct knote *kn;
2212 * KN_STAYQUEUED knote, which may or may not have
2217 while ((kn = (struct knote*)TAILQ_FIRST(&kq->kq_head)) != NULL) {
2276 kqueue_kqfilter(__unused struct fileproc *fp, struct knote *kn, __unused vfs_context_t ctx)
2387 * Query/Post each knote in the object's list
2399 knote(struct klist *list, long hint)
2401 struct knote *kn;
2423 * attach a knote to the specified list. Return true if this is the first entry.
2427 knote_attach(struct klist *list, struct knote *kn)
2435 * detach a knote from the specified list. Return true if that was the last entry.
2439 knote_detach(struct klist *list, struct knote *kn)
2441 SLIST_REMOVE(list, kn, knote, kn_selnext);
2446 * For a given knote, link a provided wait queue directly with the kqueue.
2448 * the knote to the active list at wakeup (nothing calls knote()). Instead,
2451 * kqueue and knote references are held by caller.
2456 knote_link_wait_queue(struct knote *kn, struct wait_queue *wq, wait_queue_link_t wql)
2471 * Unlink the provided wait queue from the kqueue associated with a knote.
2480 knote_unlink_wait_queue(struct knote *kn, struct wait_queue *wq, wait_queue_link_t *wqlp)
2507 struct knote *kn;
2540 knote_fdpattach(struct knote *kn, struct filedesc *fdp, struct proc *p)
2592 knote_drop(struct knote *kn, __unused struct proc *ctxp)
2606 SLIST_REMOVE(list, kn, knote, kn_link);
2624 knote_activate(struct knote *kn, int propagate)
2639 knote_deactivate(struct knote *kn)
2647 knote_enqueue(struct knote *kn)
2662 knote_dequeue(struct knote *kn)
2679 knote_zone = zinit(sizeof(struct knote), 8192*sizeof(struct knote), 8192, "knote zone");
2697 SYSINIT(knote, SI_SUB_PSEUDO, SI_ORDER_ANY, knote_init, NULL)
2699 static struct knote *
2702 return ((struct knote *)zalloc(knote_zone));
2706 knote_free(struct knote *kn)
3010 knote_markstayqueued(struct knote *kn)