summaryrefslogtreecommitdiffstats
path: root/sys/sys/sysent.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-04-02 13:53:26 +0000
committerjhb <jhb@FreeBSD.org>2007-04-02 13:53:26 +0000
commit1ad11dc4f1125b6e8655ab7e123911f5a2c152ba (patch)
treec3eb704274d5952e90c05e45007954674e3d3208 /sys/sys/sysent.h
parent6d9ee961ef98540193347377e83fbc165737a272 (diff)
downloadFreeBSD-src-1ad11dc4f1125b6e8655ab7e123911f5a2c152ba.zip
FreeBSD-src-1ad11dc4f1125b6e8655ab7e123911f5a2c152ba.tar.gz
- Split out the part of SYSCALL_MODULE_HELPER() that builds a 'struct
sysent' for a new system call into a new MAKE_SYSENT() macro. - Use MAKE_SYSENT() to build a full sysent for the nfssvc system call in the NFS server and use syscall_register() and syscall_deregister() to manage the nfssvc system call entry instead of manually frobbing the sysent[] array.
Diffstat (limited to 'sys/sys/sysent.h')
-rw-r--r--sys/sys/sysent.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index e631f04..edf1717 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -119,6 +119,14 @@ struct syscall_module_data {
struct sysent old_sysent; /* old sysent */
};
+#define MAKE_SYSENT(syscallname) \
+static struct sysent syscallname##_sysent = { \
+ (sizeof(struct syscallname ## _args ) \
+ / sizeof(register_t)), \
+ (sy_call_t *)& syscallname, \
+ SYS_AUE_##syscallname \
+}
+
#define SYSCALL_MODULE(name, offset, new_sysent, evh, arg) \
static struct syscall_module_data name##_syscall_mod = { \
evh, arg, offset, new_sysent, { 0, NULL, AUE_NULL } \
@@ -133,12 +141,7 @@ DECLARE_MODULE(name, name##_mod, SI_SUB_SYSCALLS, SI_ORDER_MIDDLE)
#define SYSCALL_MODULE_HELPER(syscallname) \
static int syscallname##_syscall = SYS_##syscallname; \
-static struct sysent syscallname##_sysent = { \
- (sizeof(struct syscallname ## _args ) \
- / sizeof(register_t)), \
- (sy_call_t *)& syscallname, \
- SYS_AUE_##syscallname \
-}; \
+MAKE_SYSENT(syscallname); \
SYSCALL_MODULE(syscallname, \
& syscallname##_syscall, & syscallname##_sysent, \
NULL, NULL);
OpenPOWER on IntegriCloud