diff options
author | Ed Schouten <ed@FreeBSD.org> | 2016-03-24 21:47:15 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2016-03-24 21:47:15 +0000 |
commit | 1f3bbfd875ed58cdd80893843d958d5575c4cebf (patch) | |
tree | 10ebf70906a0df7cec2a498c94c01578f266a88a /sys/compat/cloudabi64/cloudabi64_poll.c | |
parent | 1d640d3b42d22f66e05d4c51334c958209c977d9 (diff) | |
download | src-1f3bbfd875ed58cdd80893843d958d5575c4cebf.tar.gz src-1f3bbfd875ed58cdd80893843d958d5575c4cebf.zip |
Replace the CloudABI system call table by a machine generated version.
The type definitions and constants that were used by COMPAT_CLOUDABI64
are a literal copy of some headers stored inside of CloudABI's C
library, cloudlibc. What is annoying is that we can't make use of
cloudlibc's system call list, as the format is completely different and
doesn't provide enough information. It had to be synced in manually.
We recently decided to solve this (and some other problems) by moving
the ABI definitions into a separate file:
https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt
This file is processed by a pile of Python scripts to generate the
header files like before, documentation (markdown), but in our case more
importantly: a FreeBSD system call table.
This change discards the old files in sys/contrib/cloudabi and replaces
them by the latest copies, which requires some minor changes here and
there. Because cloudabi.txt also enforces consistent names of the system
call arguments, we have to patch up a small number of system call
implementations to use the new argument names.
The new header files can also be included directly in FreeBSD kernel
space without needing any includes/defines, so we can now remove
cloudabi_syscalldefs.h and cloudabi64_syscalldefs.h. Patch up the
sources to include the definitions directly from sys/contrib/cloudabi
instead.
Notes
Notes:
svn path=/head/; revision=297247
Diffstat (limited to 'sys/compat/cloudabi64/cloudabi64_poll.c')
-rw-r--r-- | sys/compat/cloudabi64/cloudabi64_poll.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/compat/cloudabi64/cloudabi64_poll.c b/sys/compat/cloudabi64/cloudabi64_poll.c index c8f18112229c..e44d69f2e973 100644 --- a/sys/compat/cloudabi64/cloudabi64_poll.c +++ b/sys/compat/cloudabi64/cloudabi64_poll.c @@ -30,9 +30,10 @@ __FBSDID("$FreeBSD$"); #include <sys/proc.h> #include <sys/syscallsubr.h> +#include <contrib/cloudabi/cloudabi64_types.h> + #include <compat/cloudabi/cloudabi_util.h> -#include <compat/cloudabi64/cloudabi64_syscalldefs.h> #include <compat/cloudabi64/cloudabi64_proto.h> /* Converts a FreeBSD signal number to a CloudABI signal number. */ @@ -248,7 +249,7 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi64_sys_poll_args *uap) * Bandaid to support CloudABI futex constructs that are not * implemented through FreeBSD's kqueue(). */ - if (uap->nevents == 1) { + if (uap->nsubscriptions == 1) { cloudabi64_subscription_t sub; cloudabi64_event_t ev = {}; int error; @@ -291,7 +292,7 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi64_sys_poll_args *uap) td->td_retval[0] = 1; return (copyout(&ev, uap->out, sizeof(ev))); } - } else if (uap->nevents == 2) { + } else if (uap->nsubscriptions == 2) { cloudabi64_subscription_t sub[2]; cloudabi64_event_t ev[2] = {}; int error; @@ -365,7 +366,7 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi64_sys_poll_args *uap) } } - return (kern_kevent_anonymous(td, uap->nevents, ©ops)); + return (kern_kevent_anonymous(td, uap->nsubscriptions, ©ops)); } int |