From 1ad11dc4f1125b6e8655ab7e123911f5a2c152ba Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 2 Apr 2007 13:53:26 +0000 Subject: - 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. --- sys/sys/sysent.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'sys/sys/sysent.h') 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); -- cgit v1.1