FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_ktrace.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/capability.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <sys/unistd.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/filio.h>
#include <sys/fcntl.h>
#include <sys/kthread.h>
#include <sys/selinfo.h>
#include <sys/queue.h>
#include <sys/event.h>
#include <sys/eventvar.h>
#include <sys/poll.h>
#include <sys/protosw.h>
#include <sys/sigio.h>
#include <sys/signalvar.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/sysproto.h>
#include <sys/syscallsubr.h>
#include <sys/taskqueue.h>
#include <sys/uio.h>
#include <vm/uma.h>
Go to the source code of this file.
Data Structures | |
struct | kevent_args |
Macros | |
#define | KQ_GLOBAL_LOCK(lck, haslck) |
#define | KQ_GLOBAL_UNLOCK(lck, haslck) |
#define | KNOTE_ACTIVATE(kn, islock) |
#define | KQ_LOCK(kq) |
#define | KQ_FLUX_WAKEUP(kq) |
#define | KQ_UNLOCK_FLUX(kq) |
#define | KQ_UNLOCK(kq) |
#define | KQ_OWNED(kq) |
#define | KQ_NOTOWNED(kq) |
#define | KN_LIST_LOCK(kn) |
#define | KN_LIST_UNLOCK(kn) |
#define | KNL_ASSERT_LOCK(knl, islocked) |
#define | KNL_ASSERT_LOCKED(knl) do {} while(0) |
#define | KNL_ASSERT_UNLOCKED(knl) do {} while (0) |
#define | KN_HASHSIZE 64 /* XXX should be tunable */ |
#define | KN_HASH(val, mask) (((val) ^ (val >> 8)) & (mask)) |
Functions | |
__FBSDID ("$BSDSUniX$") | |
static | MALLOC_DEFINE (M_KQUEUE,"kqueue","memory for kqueue system") |
MTX_SYSINIT (kq_global,&kq_global,"kqueue order", MTX_DEF) | |
TASKQUEUE_DEFINE_THREAD (kqueue) | |
static int | kevent_copyout (void *arg, struct kevent *kevp, int count) |
static int | kevent_copyin (void *arg, struct kevent *kevp, int count) |
static int | kqueue_register (struct kqueue *kq, struct kevent *kev, struct thread *td, int waitok) |
static int | kqueue_acquire (struct file *fp, struct kqueue **kqp) |
static void | kqueue_release (struct kqueue *kq, int locked) |
static int | kqueue_expand (struct kqueue *kq, struct filterops *fops, uintptr_t ident, int waitok) |
static void | kqueue_task (void *arg, int pending) |
static int | kqueue_scan (struct kqueue *kq, int maxevents, struct kevent_copyops *k_ops, const struct timespec *timeout, struct kevent *keva, struct thread *td) |
static void | kqueue_wakeup (struct kqueue *kq) |
static struct filterops * | kqueue_fo_find (int filt) |
static void | kqueue_fo_release (int filt) |
static int | knote_attach (struct knote *kn, struct kqueue *kq) |
static void | knote_drop (struct knote *kn, struct thread *td) |
static void | knote_enqueue (struct knote *kn) |
static void | knote_dequeue (struct knote *kn) |
static void | knote_init (void) |
static struct knote * | knote_alloc (int waitok) |
static void | knote_free (struct knote *kn) |
static void | filt_kqdetach (struct knote *kn) |
static int | filt_kqueue (struct knote *kn, long hint) |
static int | filt_procattach (struct knote *kn) |
static void | filt_procdetach (struct knote *kn) |
static int | filt_proc (struct knote *kn, long hint) |
static int | filt_fileattach (struct knote *kn) |
static void | filt_timerexpire (void *knx) |
static int | filt_timerattach (struct knote *kn) |
static void | filt_timerdetach (struct knote *kn) |
static int | filt_timer (struct knote *kn, long hint) |
static int | filt_userattach (struct knote *kn) |
static void | filt_userdetach (struct knote *kn) |
static int | filt_user (struct knote *kn, long hint) |
static void | filt_usertouch (struct knote *kn, struct kevent *kev, u_long type) |
SYSCTL_INT (_kern, OID_AUTO, kq_calloutmax, CTLFLAG_RW,&kq_calloutmax, 0,"Maximum number of callouts allocated for kqueue") | |
static int | filt_nullattach (struct knote *kn) |
MTX_SYSINIT (kqueue_filterops,&filterops_lock,"protect sysfilt_ops", MTX_DEF) | |
static int | kqueue_kqfilter (struct file *fp, struct knote *kn) |
void | knote_fork (struct knlist *list, int pid) |
static int | timertoticks (intptr_t data) |
static void | filt_userdetach (__unused struct knote *kn) |
static int | filt_user (struct knote *kn, __unused long hint) |
int | sys_kqueue (struct thread *td, struct kqueue_args *uap) |
int | sys_kevent (struct thread *td, struct kevent_args *uap) |
int | kern_kevent (struct thread *td, int fd, int nchanges, int nevents, struct kevent_copyops *k_ops, const struct timespec *timeout) |
int | kqueue_add_filteropts (int filt, struct filterops *filtops) |
int | kqueue_del_filteropts (int filt) |
static void | kqueue_schedtask (struct kqueue *kq) |
static int | kqueue_read (struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) |
static int | kqueue_write (struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) |
static int | kqueue_truncate (struct file *fp, off_t length, struct ucred *active_cred, struct thread *td) |
static int | kqueue_ioctl (struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) |
static int | kqueue_poll (struct file *fp, int events, struct ucred *active_cred, struct thread *td) |
static int | kqueue_stat (struct file *fp, struct stat *st, struct ucred *active_cred, struct thread *td) |
static int | kqueue_close (struct file *fp, struct thread *td) |
void | knote (struct knlist *list, long hint, int lockflags) |
void | knlist_add (struct knlist *knl, struct knote *kn, int islocked) |
static void | knlist_remove_kq (struct knlist *knl, struct knote *kn, int knlislocked, int kqislocked) |
void | knlist_remove (struct knlist *knl, struct knote *kn, int islocked) |
void | knlist_remove_inevent (struct knlist *knl, struct knote *kn) |
int | knlist_empty (struct knlist *knl) |
MTX_SYSINIT (knlist_lock,&knlist_lock,"knlist lock for lockless objects", MTX_DEF) | |
static void | knlist_mtx_lock (void *arg) |
static void | knlist_mtx_unlock (void *arg) |
static void | knlist_mtx_assert_locked (void *arg) |
static void | knlist_mtx_assert_unlocked (void *arg) |
void | knlist_init (struct knlist *knl, void *lock, void(*kl_lock)(void *), void(*kl_unlock)(void *), void(*kl_assert_locked)(void *), void(*kl_assert_unlocked)(void *)) |
void | knlist_init_mtx (struct knlist *knl, struct mtx *lock) |
void | knlist_destroy (struct knlist *knl) |
void | knlist_cleardel (struct knlist *knl, struct thread *td, int islocked, int killkn) |
void | knote_fdclose (struct thread *td, int fd) |
SYSINIT (knote, SI_SUB_PSEUDO, SI_ORDER_ANY, knote_init, NULL) | |
int | kqfd_register (int fd, struct kevent *kev, struct thread *td, int waitok) |
Variables | |
static struct mtx | kq_global |
static fo_rdwr_t | kqueue_read |
static fo_rdwr_t | kqueue_write |
static fo_truncate_t | kqueue_truncate |
static fo_ioctl_t | kqueue_ioctl |
static fo_poll_t | kqueue_poll |
static fo_kqfilter_t | kqueue_kqfilter |
static fo_stat_t | kqueue_stat |
static fo_close_t | kqueue_close |
static struct fileops | kqueueops |
static struct filterops | file_filtops |
static struct filterops | kqread_filtops |
static struct filterops | proc_filtops |
static struct filterops | timer_filtops |
static struct filterops | user_filtops |
static uma_zone_t | knote_zone |
static int | kq_ncallouts = 0 |
static int | kq_calloutmax = (4 * 1024) |
struct filterops | null_filtops |
struct filterops | sig_filtops |
struct filterops | fs_filtops |
static struct mtx | filterops_lock |
struct { | |
struct filterops * for_fop | |
int for_refcnt | |
} | sysfilt_ops [EVFILT_SYSCOUNT] |
static struct mtx | knlist_lock |
Definition at line 250 of file kern_event.c.
Referenced by knote_attach(), knote_drop(), and kqueue_register().
#define KN_HASHSIZE 64 /* XXX should be tunable */ |
Definition at line 249 of file kern_event.c.
Referenced by kqueue_expand().
#define KN_LIST_LOCK | ( | kn | ) |
Definition at line 223 of file kern_event.c.
Referenced by kqueue_register(), and kqueue_scan().
#define KN_LIST_UNLOCK | ( | kn | ) |
Definition at line 227 of file kern_event.c.
Referenced by kqueue_register(), and kqueue_scan().
#define KNL_ASSERT_LOCK | ( | knl, | |
islocked | |||
) |
Definition at line 231 of file kern_event.c.
Referenced by knlist_add(), knlist_remove_kq(), and knote().
#define KNL_ASSERT_LOCKED | ( | knl | ) | do {} while(0) |
Definition at line 245 of file kern_event.c.
Referenced by knlist_cleardel(), and knlist_empty().
#define KNL_ASSERT_UNLOCKED | ( | knl | ) | do {} while (0) |
Definition at line 246 of file kern_event.c.
Referenced by knlist_cleardel().
#define KNOTE_ACTIVATE | ( | kn, | |
islock | |||
) |
Definition at line 190 of file kern_event.c.
Referenced by filt_procattach(), filt_timerexpire(), knote(), knote_fork(), and kqueue_register().
#define KQ_FLUX_WAKEUP | ( | kq | ) |
Definition at line 204 of file kern_event.c.
Referenced by kqueue_scan().
#define KQ_GLOBAL_LOCK | ( | lck, | |
haslck | |||
) |
Definition at line 78 of file kern_event.c.
Referenced by kqueue_register(), kqueue_scan(), and kqueue_task().
#define KQ_GLOBAL_UNLOCK | ( | lck, | |
haslck | |||
) |
Definition at line 83 of file kern_event.c.
Referenced by kqueue_register(), kqueue_scan(), and kqueue_task().
#define KQ_LOCK | ( | kq | ) |
Definition at line 201 of file kern_event.c.
Referenced by knlist_add(), knlist_cleardel(), knlist_remove_kq(), knote(), knote_drop(), knote_fdclose(), knote_fork(), kqueue_acquire(), kqueue_close(), kqueue_expand(), kqueue_poll(), kqueue_register(), kqueue_release(), kqueue_scan(), and kqueue_task().
#define KQ_NOTOWNED | ( | kq | ) |
Definition at line 220 of file kern_event.c.
Referenced by knlist_add(), knote_drop(), kqueue_expand(), and kqueue_scan().
#define KQ_OWNED | ( | kq | ) |
Definition at line 217 of file kern_event.c.
Referenced by knote_attach(), knote_dequeue(), knote_enqueue(), kqueue_release(), kqueue_scan(), kqueue_schedtask(), and kqueue_wakeup().
#define KQ_UNLOCK | ( | kq | ) |
Definition at line 214 of file kern_event.c.
Referenced by knlist_add(), knlist_cleardel(), knlist_remove_kq(), knote(), knote_fdclose(), knote_fork(), kqueue_acquire(), kqueue_close(), kqueue_expand(), kqueue_poll(), kqueue_register(), kqueue_release(), kqueue_scan(), and kqueue_task().
#define KQ_UNLOCK_FLUX | ( | kq | ) |
Definition at line 210 of file kern_event.c.
Referenced by knote(), knote_drop(), knote_fdclose(), knote_fork(), kqueue_register(), and kqueue_scan().
__FBSDID | ( | "$BSDSUniX$" | ) |
|
static |
Definition at line 296 of file kern_event.c.
|
static |
Definition at line 319 of file kern_event.c.
References knlist_remove().
|
static |
Definition at line 328 of file kern_event.c.
|
static |
Definition at line 253 of file kern_event.c.
|
static |
Definition at line 409 of file kern_event.c.
References knlist_remove_inevent().
Referenced by filt_procattach().
|
static |
Definition at line 338 of file kern_event.c.
References filt_proc(), knlist_add(), KNOTE_ACTIVATE, p_cansee(), pfind(), and zpfind().
|
static |
Definition at line 398 of file kern_event.c.
References knlist_remove().
|
static |
Definition at line 597 of file kern_event.c.
|
static |
Definition at line 562 of file kern_event.c.
References callout_init(), filt_timerexpire(), kq_calloutmax, kq_ncallouts, malloc(), and timertoticks().
|
static |
Definition at line 585 of file kern_event.c.
References free(), and kq_ncallouts.
|
static |
Definition at line 536 of file kern_event.c.
References knote(), KNOTE_ACTIVATE, and timertoticks().
Referenced by filt_timerattach().
|
static |
|
static |
Definition at line 628 of file kern_event.c.
|
static |
Definition at line 604 of file kern_event.c.
|
static |
|
static |
Definition at line 619 of file kern_event.c.
|
static |
Definition at line 635 of file kern_event.c.
References panic().
int kern_kevent | ( | struct thread * | td, |
int | fd, | ||
int | nchanges, | ||
int | nevents, | ||
struct kevent_copyops * | k_ops, | ||
const struct timespec * | timeout | ||
) |
Definition at line 823 of file kern_event.c.
References fget(), kqueue_acquire(), kqueue_register(), kqueue_release(), and kqueue_scan().
Referenced by sys_kevent().
|
static |
Definition at line 808 of file kern_event.c.
References kevent_args::changelist, and count.
Referenced by sys_kevent().
|
static |
Definition at line 790 of file kern_event.c.
References count, and kevent_args::eventlist.
Referenced by sys_kevent().
void knlist_add | ( | struct knlist * | knl, |
struct knote * | kn, | ||
int | islocked | ||
) |
Definition at line 1866 of file kern_event.c.
References KNL_ASSERT_LOCK, KQ_LOCK, KQ_NOTOWNED, and KQ_UNLOCK.
Referenced by filt_aioattach(), filt_fsattach(), filt_lioattach(), filt_procattach(), filt_sigattach(), kqueue_kqfilter(), logkqfilter(), mqf_kqfilter(), pipe_kqfilter(), ptsdev_kqfilter(), soo_kqfilter(), ttydev_kqfilter(), and vfs_kqfilter().
void knlist_cleardel | ( | struct knlist * | knl, |
struct thread * | td, | ||
int | islocked, | ||
int | killkn | ||
) |
Definition at line 2023 of file kern_event.c.
References KNL_ASSERT_LOCKED, KNL_ASSERT_UNLOCKED, knlist_remove_kq(), knote(), knote_drop(), KQ_LOCK, and KQ_UNLOCK.
void knlist_destroy | ( | struct knlist * | knl | ) |
Definition at line 2002 of file kern_event.c.
References printf().
Referenced by destroy_vpollinfo_free(), exit1(), kqueue_close(), mqueue_free(), pipeclose(), ptsdrv_free(), sofree(), and tty_dealloc().
int knlist_empty | ( | struct knlist * | knl | ) |
Definition at line 1927 of file kern_event.c.
References KNL_ASSERT_LOCKED.
Referenced by filt_aiodetach(), filt_liodetach(), filt_sordetach(), filt_sowdetach(), kqueue_close(), and kqueue_wakeup().
void knlist_init | ( | struct knlist * | knl, |
void * | lock, | ||
void(*)(void *) | kl_lock, | ||
void(*)(void *) | kl_unlock, | ||
void(*)(void *) | kl_assert_locked, | ||
void(*)(void *) | kl_assert_unlocked | ||
) |
Definition at line 1964 of file kern_event.c.
References knlist_lock, knlist_mtx_assert_locked(), knlist_mtx_assert_unlocked(), knlist_mtx_lock(), and knlist_mtx_unlock().
Referenced by knlist_init_mtx(), and v_addpollinfo().
void knlist_init_mtx | ( | struct knlist * | knl, |
struct mtx * | lock | ||
) |
Definition at line 1995 of file kern_event.c.
References knlist_init().
Referenced by aio_aqueue(), do_pipe(), fork1(), kern_lio_listio(), log_drvinit(), mqueue_alloc(), proc0_init(), pts_alloc(), pts_alloc_external(), socreate(), sonewconn(), sys_kqueue(), tty_alloc_mutex(), and vfs_event_init().
|
static |
Definition at line 1952 of file kern_event.c.
Referenced by knlist_init().
|
static |
Definition at line 1958 of file kern_event.c.
Referenced by knlist_init().
|
static |
Definition at line 1940 of file kern_event.c.
Referenced by knlist_init().
|
static |
Definition at line 1946 of file kern_event.c.
Referenced by knlist_init().
void knlist_remove | ( | struct knlist * | knl, |
struct knote * | kn, | ||
int | islocked | ||
) |
Definition at line 1909 of file kern_event.c.
References knlist_remove_kq().
Referenced by filt_aiodetach(), filt_fsdetach(), filt_kqdetach(), filt_liodetach(), filt_mqdetach(), filt_pipedetach(), filt_procdetach(), filt_sigdetach(), filt_sordetach(), filt_sowdetach(), filt_vfsdetach(), logkqdetach(), pts_kqops_read_detach(), pts_kqops_write_detach(), tty_kqops_read_detach(), and tty_kqops_write_detach().
void knlist_remove_inevent | ( | struct knlist * | knl, |
struct knote * | kn | ||
) |
Definition at line 1919 of file kern_event.c.
References knlist_remove_kq().
Referenced by filt_proc().
|
static |
Definition at line 1884 of file kern_event.c.
References KNL_ASSERT_LOCK, knote(), KQ_LOCK, and KQ_UNLOCK.
Referenced by knlist_cleardel(), knlist_remove(), and knlist_remove_inevent().
void knote | ( | struct knlist * | list, |
long | hint, | ||
int | lockflags | ||
) |
Definition at line 1806 of file kern_event.c.
References KNL_ASSERT_LOCK, KNOTE_ACTIVATE, KQ_LOCK, KQ_UNLOCK, and KQ_UNLOCK_FLUX.
Referenced by filt_timerexpire(), knlist_cleardel(), knlist_remove_kq(), knote_alloc(), knote_drop(), knote_fdclose(), knote_fork(), knote_init(), kqueue_close(), kqueue_register(), kqueue_scan(), and vfs_kqfilter().
|
static |
Definition at line 2222 of file kern_event.c.
References knote(), and knote_zone.
Referenced by kqueue_register(), and kqueue_scan().
|
static |
Definition at line 2125 of file kern_event.c.
References KN_HASH, and KQ_OWNED.
Referenced by kqueue_register().
|
static |
Definition at line 2200 of file kern_event.c.
References KQ_OWNED.
Referenced by knote_drop().
|
static |
Definition at line 2153 of file kern_event.c.
References KN_HASH, knote(), knote_dequeue(), knote_free(), KQ_LOCK, KQ_NOTOWNED, KQ_UNLOCK_FLUX, and kqueue_fo_release().
Referenced by knlist_cleardel(), knote_fdclose(), kqueue_close(), kqueue_register(), and kqueue_scan().
|
static |
Definition at line 2186 of file kern_event.c.
References KQ_OWNED, and kqueue_wakeup().
Referenced by kqueue_register().
void knote_fdclose | ( | struct thread * | td, |
int | fd | ||
) |
Definition at line 2084 of file kern_event.c.
References knote(), knote_drop(), KQ_LOCK, KQ_UNLOCK, KQ_UNLOCK_FLUX, and wakeup().
Referenced by do_dup(), fdcloseexec(), kern_close(), and setugidsafety().
void knote_fork | ( | struct knlist * | list, |
int | pid | ||
) |
Definition at line 452 of file kern_event.c.
References knote(), KNOTE_ACTIVATE, KQ_LOCK, KQ_UNLOCK, KQ_UNLOCK_FLUX, and kqueue_register().
Referenced by do_fork().
|
static |
Definition at line 2229 of file kern_event.c.
References knote_zone.
Referenced by knote_drop(), kqueue_register(), and kqueue_scan().
|
static |
Definition at line 2213 of file kern_event.c.
References knote(), and knote_zone.
int kqfd_register | ( | int | fd, |
struct kevent * | kev, | ||
struct thread * | td, | ||
int | waitok | ||
) |
Definition at line 2239 of file kern_event.c.
References fget(), kqueue_acquire(), kqueue_register(), and kqueue_release().
Referenced by aio_aqueue(), and kern_lio_listio().
|
static |
Definition at line 1185 of file kern_event.c.
References KQ_LOCK, and KQ_UNLOCK.
Referenced by kern_kevent(), kqfd_register(), kqueue_close(), and kqueue_poll().
int kqueue_add_filteropts | ( | int | filt, |
struct filterops * | filtops | ||
) |
Definition at line 881 of file kern_event.c.
References filterops_lock, for_fop, null_filtops, printf(), and sysfilt_ops.
Referenced by aio_onceonly().
|
static |
Definition at line 1670 of file kern_event.c.
References free(), funsetown(), knlist_destroy(), knlist_empty(), knote(), knote_drop(), KQ_LOCK, KQ_UNLOCK, kqueue_acquire(), mtx_destroy(), seldrain(), and selwakeuppri().
int kqueue_del_filteropts | ( | int | filt | ) |
Definition at line 906 of file kern_event.c.
References filterops_lock, for_fop, for_refcnt, null_filtops, and sysfilt_ops.
Referenced by aio_unload().
|
static |
Definition at line 1245 of file kern_event.c.
References fd, free(), hashinit(), KN_HASHSIZE, KQ_LOCK, KQ_NOTOWNED, KQ_UNLOCK, and malloc().
Referenced by kqueue_register().
|
static |
Definition at line 930 of file kern_event.c.
References filterops_lock, for_fop, null_filtops, and sysfilt_ops.
Referenced by kqueue_register().
|
static |
Definition at line 946 of file kern_event.c.
References filterops_lock, for_refcnt, and sysfilt_ops.
Referenced by knote_drop(), and kqueue_register().
|
static |
Definition at line 1577 of file kern_event.c.
References fgetown(), and fsetown().
|
static |
Definition at line 304 of file kern_event.c.
References knlist_add(), and kqread_filtops.
|
static |
Definition at line 1625 of file kern_event.c.
References KQ_LOCK, KQ_UNLOCK, kqueue_acquire(), kqueue_release(), and selrecord().
|
static |
Definition at line 1552 of file kern_event.c.
|
static |
Definition at line 965 of file kern_event.c.
References fget(), KN_HASH, KN_LIST_LOCK, KN_LIST_UNLOCK, knote(), KNOTE_ACTIVATE, knote_alloc(), knote_attach(), knote_drop(), knote_enqueue(), knote_free(), kq_global, KQ_GLOBAL_LOCK, KQ_GLOBAL_UNLOCK, KQ_LOCK, KQ_UNLOCK, KQ_UNLOCK_FLUX, kqueue_expand(), kqueue_fo_find(), and kqueue_fo_release().
Referenced by kern_kevent(), knote_fork(), and kqfd_register().
|
static |
Definition at line 1208 of file kern_event.c.
References KQ_LOCK, KQ_OWNED, KQ_UNLOCK, and wakeup().
Referenced by kern_kevent(), kqfd_register(), and kqueue_poll().
|
static |
Definition at line 1334 of file kern_event.c.
References count, getmicrouptime(), hz, itimerfix(), KN_LIST_LOCK, KN_LIST_UNLOCK, knote(), knote_alloc(), knote_drop(), knote_free(), KQ_FLUX_WAKEUP, kq_global, KQ_GLOBAL_LOCK, KQ_GLOBAL_UNLOCK, KQ_LOCK, KQ_NOTOWNED, KQ_OWNED, KQ_UNLOCK, KQ_UNLOCK_FLUX, start, timeout(), timevaladd(), timevalsub(), and tvtohz().
Referenced by kern_kevent().
|
static |
Definition at line 1222 of file kern_event.c.
References KQ_OWNED, and taskqueue_enqueue().
Referenced by kqueue_wakeup().
|
static |
Definition at line 1652 of file kern_event.c.
|
static |
Definition at line 1308 of file kern_event.c.
References kq_global, KQ_GLOBAL_LOCK, KQ_GLOBAL_UNLOCK, KQ_LOCK, KQ_UNLOCK, and wakeup().
Referenced by sys_kqueue().
|
static |
Definition at line 1568 of file kern_event.c.
|
static |
Definition at line 1777 of file kern_event.c.
References knlist_empty(), KQ_OWNED, kqueue_schedtask(), pgsigio(), selwakeuppri(), and wakeup().
Referenced by knote_enqueue().
|
static |
Definition at line 1560 of file kern_event.c.
|
static |
MTX_SYSINIT | ( | kq_global | , |
& | kq_global, | ||
"kqueue order" | , | ||
MTX_DEF | |||
) |
MTX_SYSINIT | ( | kqueue_filterops | , |
& | filterops_lock, | ||
"protect sysfilt_ops" | , | ||
MTX_DEF | |||
) |
MTX_SYSINIT | ( | knlist_lock | , |
& | knlist_lock, | ||
"knlist lock for lockless objects" | , | ||
MTX_DEF | |||
) |
int sys_kevent | ( | struct thread * | td, |
struct kevent_args * | uap | ||
) |
Definition at line 735 of file kern_event.c.
References kevent_args::changelist, cloneuio(), kevent_args::eventlist, kevent_args::fd, kern_kevent(), kevent_copyin(), kevent_copyout(), kevent_args::nchanges, kevent_args::nevents, kevent_args::timeout, and ts.
int sys_kqueue | ( | struct thread * | td, |
struct kqueue_args * | uap | ||
) |
Definition at line 692 of file kern_event.c.
References falloc(), fd, finit(), knlist_init_mtx(), kqueue_task(), kqueueops, malloc(), and mtx_init().
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
kq_calloutmax | , | ||
CTLFLAG_RW | , | ||
& | kq_calloutmax, | ||
0 | , | ||
"Maximum number of callouts allocated for kqueue" | |||
) |
SYSINIT | ( | knote | , |
SI_SUB_PSEUDO | , | ||
SI_ORDER_ANY | , | ||
knote_init | , | ||
NULL | |||
) |
TASKQUEUE_DEFINE_THREAD | ( | kqueue | ) |
|
static |
Definition at line 523 of file kern_event.c.
References tvtohz().
Referenced by filt_timerattach(), and filt_timerexpire().
|
static |
Definition at line 154 of file kern_event.c.
|
static |
Definition at line 271 of file kern_event.c.
Referenced by kqueue_add_filteropts(), kqueue_del_filteropts(), kqueue_fo_find(), and kqueue_fo_release().
struct filterops* for_fop |
Definition at line 275 of file kern_event.c.
Referenced by kqueue_add_filteropts(), kqueue_del_filteropts(), and kqueue_fo_find().
int for_refcnt |
Definition at line 276 of file kern_event.c.
Referenced by kqueue_del_filteropts(), and kqueue_fo_release().
struct filterops fs_filtops |
Definition at line 4419 of file vfs_subr.c.
|
static |
Definition at line 1933 of file kern_event.c.
Referenced by knlist_init().
|
static |
Definition at line 183 of file kern_event.c.
Referenced by knote_alloc(), knote_free(), and knote_init().
|
static |
Definition at line 185 of file kern_event.c.
Referenced by filt_timerattach().
|
static |
Definition at line 76 of file kern_event.c.
Referenced by kqueue_register(), kqueue_scan(), and kqueue_task().
|
static |
Definition at line 184 of file kern_event.c.
Referenced by filt_timerattach(), and filt_timerdetach().
|
static |
Definition at line 158 of file kern_event.c.
Referenced by kqueue_kqfilter().
|
static |
Definition at line 115 of file kern_event.c.
|
static |
Definition at line 111 of file kern_event.c.
|
static |
Definition at line 113 of file kern_event.c.
|
static |
Definition at line 112 of file kern_event.c.
|
static |
Definition at line 108 of file kern_event.c.
|
static |
Definition at line 114 of file kern_event.c.
|
static |
Definition at line 110 of file kern_event.c.
|
static |
Definition at line 109 of file kern_event.c.
|
static |
Definition at line 117 of file kern_event.c.
Referenced by sys_kqueue().
struct filterops null_filtops |
Definition at line 259 of file kern_event.c.
Referenced by kqueue_add_filteropts(), kqueue_del_filteropts(), and kqueue_fo_find().
|
static |
Definition at line 164 of file kern_event.c.
struct filterops sig_filtops |
Definition at line 118 of file kern_sig.c.
struct { ... } sysfilt_ops[EVFILT_SYSCOUNT] |
Referenced by kqueue_add_filteropts(), kqueue_del_filteropts(), kqueue_fo_find(), and kqueue_fo_release().
|
static |
Definition at line 170 of file kern_event.c.
|
static |
Definition at line 176 of file kern_event.c.