mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 08:54:44 +08:00
sys/event.h: Update to FreeBSD head 2016-06-27
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
* $FreeBSD: head/sys/sys/event.h 302242 2016-06-27 23:34:53Z kib $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_EVENT_H_
|
||||
@@ -38,11 +38,12 @@
|
||||
#define EVFILT_PROC (-5) /* attached to struct proc */
|
||||
#define EVFILT_SIGNAL (-6) /* attached to struct proc */
|
||||
#define EVFILT_TIMER (-7) /* timers */
|
||||
/* EVFILT_NETDEV (-8) no longer supported */
|
||||
#define EVFILT_PROCDESC (-8) /* attached to process descriptors */
|
||||
#define EVFILT_FS (-9) /* filesystem events */
|
||||
#define EVFILT_LIO (-10) /* attached to lio requests */
|
||||
#define EVFILT_USER (-11) /* User events */
|
||||
#define EVFILT_SYSCOUNT 11
|
||||
#define EVFILT_SENDFILE (-12) /* attached to sendfile requests */
|
||||
#define EVFILT_SYSCOUNT 12
|
||||
|
||||
#define EV_SET(kevp_, a, b, c, d, e, f) do { \
|
||||
struct kevent *kevp = (kevp_); \
|
||||
@@ -68,6 +69,7 @@ struct kevent {
|
||||
#define EV_DELETE 0x0002 /* delete event from kq */
|
||||
#define EV_ENABLE 0x0004 /* enable event */
|
||||
#define EV_DISABLE 0x0008 /* disable event (not reported) */
|
||||
#define EV_FORCEONESHOT 0x0100 /* enable _ONESHOT and force trigger */
|
||||
|
||||
/* flags */
|
||||
#define EV_ONESHOT 0x0010 /* only report one occurrence */
|
||||
@@ -78,6 +80,7 @@ struct kevent {
|
||||
#define EV_SYSFLAGS 0xF000 /* reserved by system */
|
||||
#define EV_DROP 0x1000 /* note should be dropped */
|
||||
#define EV_FLAG1 0x2000 /* filter-specific flag */
|
||||
#define EV_FLAG2 0x4000 /* filter-specific flag */
|
||||
|
||||
/* returned values */
|
||||
#define EV_EOF 0x8000 /* EOF detected */
|
||||
@@ -106,6 +109,7 @@ struct kevent {
|
||||
* data/hint flags for EVFILT_{READ|WRITE}, shared with userspace
|
||||
*/
|
||||
#define NOTE_LOWAT 0x0001 /* low water mark */
|
||||
#define NOTE_FILE_POLL 0x0002 /* behave like poll() */
|
||||
|
||||
/*
|
||||
* data/hint flags for EVFILT_VNODE, shared with userspace
|
||||
@@ -117,9 +121,15 @@ struct kevent {
|
||||
#define NOTE_LINK 0x0010 /* link count changed */
|
||||
#define NOTE_RENAME 0x0020 /* vnode was renamed */
|
||||
#define NOTE_REVOKE 0x0040 /* vnode access was revoked */
|
||||
#define NOTE_OPEN 0x0080 /* vnode was opened */
|
||||
#define NOTE_CLOSE 0x0100 /* file closed, fd did not
|
||||
allowed write */
|
||||
#define NOTE_CLOSE_WRITE 0x0200 /* file closed, fd did allowed
|
||||
write */
|
||||
#define NOTE_READ 0x0400 /* file was read */
|
||||
|
||||
/*
|
||||
* data/hint flags for EVFILT_PROC, shared with userspace
|
||||
* data/hint flags for EVFILT_PROC and EVFILT_PROCDESC, shared with userspace
|
||||
*/
|
||||
#define NOTE_EXIT 0x80000000 /* process exited */
|
||||
#define NOTE_FORK 0x40000000 /* process forked */
|
||||
@@ -132,6 +142,12 @@ struct kevent {
|
||||
#define NOTE_TRACKERR 0x00000002 /* could not track child */
|
||||
#define NOTE_CHILD 0x00000004 /* am a child process */
|
||||
|
||||
/* additional flags for EVFILT_TIMER */
|
||||
#define NOTE_SECONDS 0x00000001 /* data is seconds */
|
||||
#define NOTE_MSECONDS 0x00000002 /* data is milliseconds */
|
||||
#define NOTE_USECONDS 0x00000004 /* data is microseconds */
|
||||
#define NOTE_NSECONDS 0x00000008 /* data is nanoseconds */
|
||||
|
||||
struct knote;
|
||||
SLIST_HEAD(klist, knote);
|
||||
struct kqueue;
|
||||
@@ -142,16 +158,13 @@ struct knlist {
|
||||
void (*kl_unlock)(void *);
|
||||
void (*kl_assert_locked)(void *);
|
||||
void (*kl_assert_unlocked)(void *);
|
||||
void *kl_lockarg; /* argument passed to kl_lockf() */
|
||||
void *kl_lockarg; /* argument passed to lock functions */
|
||||
int kl_autodestroy;
|
||||
};
|
||||
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#ifdef MALLOC_DECLARE
|
||||
MALLOC_DECLARE(M_KQUEUE);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Flags for knote call
|
||||
*/
|
||||
@@ -216,8 +229,10 @@ struct knote {
|
||||
union {
|
||||
struct file *p_fp; /* file data pointer */
|
||||
struct proc *p_proc; /* proc pointer */
|
||||
struct aiocblist *p_aio; /* AIO job pointer */
|
||||
struct aioliojob *p_lio; /* LIO job pointer */
|
||||
struct kaiocb *p_aio; /* AIO job pointer */
|
||||
struct aioliojob *p_lio; /* LIO job pointer */
|
||||
sbintime_t *p_nexttime; /* next timer event fires at */
|
||||
void *p_v; /* generic other pointer */
|
||||
} kn_ptr;
|
||||
struct filterops *kn_fop;
|
||||
void *kn_hook;
|
||||
@@ -240,17 +255,20 @@ struct thread;
|
||||
struct proc;
|
||||
struct knlist;
|
||||
struct mtx;
|
||||
struct rwlock;
|
||||
|
||||
extern void knote(struct knlist *list, long hint, int lockflags);
|
||||
extern void knote_fork(struct knlist *list, int pid);
|
||||
extern struct knlist *knlist_alloc(struct mtx *lock);
|
||||
extern void knlist_detach(struct knlist *knl);
|
||||
extern void knlist_add(struct knlist *knl, struct knote *kn, int islocked);
|
||||
extern void knlist_remove(struct knlist *knl, struct knote *kn, int islocked);
|
||||
extern void knlist_remove_inevent(struct knlist *knl, struct knote *kn);
|
||||
extern int knlist_empty(struct knlist *knl);
|
||||
extern 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 *));
|
||||
extern void knlist_init_mtx(struct knlist *knl, struct mtx *lock);
|
||||
extern void knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock);
|
||||
extern void knlist_destroy(struct knlist *knl);
|
||||
extern void knlist_cleardel(struct knlist *knl, struct thread *td,
|
||||
int islocked, int killkn);
|
||||
|
||||
Reference in New Issue
Block a user