diff options
author | julian <julian@FreeBSD.org> | 2016-12-02 05:47:52 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2016-12-02 05:47:52 +0000 |
commit | 0465785c41747214c1e081431fe93a9daacdc6fd (patch) | |
tree | 810b24b3768d40b811b00c5f58a5a0a3f1cfafa0 /sys/sys/sysent.h | |
parent | d70c98850f70ec4b1f57ba7a96b57aadf970535c (diff) | |
download | FreeBSD-src-0465785c41747214c1e081431fe93a9daacdc6fd.zip FreeBSD-src-0465785c41747214c1e081431fe93a9daacdc6fd.tar.gz |
MFH: r303287
Split MAKE_SYSENT into two parts so that the initializer part can be
used separately if one wants to embed the sysent into a larger structure.
Diffstat (limited to 'sys/sys/sysent.h')
-rw-r--r-- | sys/sys/sysent.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 25dc940..c3818a3 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -175,13 +175,21 @@ struct syscall_module_data { int flags; /* flags for syscall_register */ }; -#define MAKE_SYSENT(syscallname) \ -static struct sysent syscallname##_sysent = { \ - (sizeof(struct syscallname ## _args ) \ +/* separate initialization vector so it can be used in a substructure */ +#define SYSENT_INIT_VALS(_syscallname) { \ + .sy_narg = (sizeof(struct _syscallname ## _args ) \ / sizeof(register_t)), \ - (sy_call_t *)& sys_##syscallname, \ - SYS_AUE_##syscallname \ -} + .sy_call = (sy_call_t *)&sys_##_syscallname, \ + .sy_auevent = SYS_AUE_##_syscallname, \ + .sy_systrace_args_func = NULL, \ + .sy_entry = 0, \ + .sy_return = 0, \ + .sy_flags = 0, \ + .sy_thrcnt = 0 \ +} + +#define MAKE_SYSENT(syscallname) \ +static struct sysent syscallname##_sysent = SYSENT_INIT_VALS(syscallname); #define MAKE_SYSENT_COMPAT(syscallname) \ static struct sysent syscallname##_sysent = { \ |