summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2017-06-17 00:57:26 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-08 08:15:17 +0200
commite9b708ab2afc45745b0c8d4deff5f6e3e6014c4c (patch)
treecfc5a1e29dc084236acbac1d03d5205fcedffbf8
parentFix typo. (diff)
downloadrtems-e9b708ab2afc45745b0c8d4deff5f6e3e6014c4c.tar.bz2
Add abstime kqueue(2) timers and expand struct kevent members.
This change implements NOTE_ABSTIME flag for EVFILT_TIMER, which specifies that the data field contains absolute time to fire the event. To make this useful, data member of the struct kevent must be extended to 64bit. Using the opportunity, I also added ext members. This changes struct kevent almost to Apple struct kevent64, except I did not changed type of ident and udata, the later would cause serious API incompatibilities. The type of ident was kept uintptr_t since EVFILT_AIO returns a pointer in this field, and e.g. CHERI is sensitive to the type (discussed with brooks, jhb). Unlike Apple kevent64, symbol versioning allows us to claim ABI compatibility and still name the new syscall kevent(2). Compat shims are provided for both host native and compat32. Requested by: bapt Reviewed by: bapt, brooks, ngie (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D11025
-rw-r--r--cpukit/include/sys/event.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/cpukit/include/sys/event.h b/cpukit/include/sys/event.h
index a4f91e091f..d1cfb58e9c 100644
--- a/cpukit/include/sys/event.h
+++ b/cpukit/include/sys/event.h
@@ -55,6 +55,10 @@
(kevp)->fflags = (d); \
(kevp)->data = (e); \
(kevp)->udata = (f); \
+ (kevp)->ext[0] = 0; \
+ (kevp)->ext[1] = 0; \
+ (kevp)->ext[2] = 0; \
+ (kevp)->ext[3] = 0; \
} while(0)
struct kevent {
@@ -62,8 +66,9 @@ struct kevent {
short filter; /* filter for event */
unsigned short flags;
unsigned int fflags;
- __intptr_t data;
+ __int64_t data;
void *udata; /* opaque user data identifier */
+ __uint64_t ext[4];
};
/* actions */
@@ -149,6 +154,7 @@ struct kevent {
#define NOTE_MSECONDS 0x00000002 /* data is milliseconds */
#define NOTE_USECONDS 0x00000004 /* data is microseconds */
#define NOTE_NSECONDS 0x00000008 /* data is nanoseconds */
+#define NOTE_ABSTIME 0x00000010 /* timeout is absolute */
struct knote;
SLIST_HEAD(klist, knote);
@@ -232,7 +238,7 @@ struct knote {
#define KN_SCAN 0x100 /* flux set in kqueue_scan() */
int kn_influx;
int kn_sfflags; /* saved filter flags */
- intptr_t kn_sdata; /* saved data field */
+ int64_t kn_sdata; /* saved data field */
union {
struct file *p_fp; /* file data pointer */
struct proc *p_proc; /* proc pointer */
@@ -253,6 +259,7 @@ struct kevent_copyops {
void *arg;
int (*k_copyout)(void *arg, struct kevent *kevp, int count);
int (*k_copyin)(void *arg, struct kevent *kevp, int count);
+ size_t kevent_size;
};
struct thread;