Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/sysent.h
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | |||||
* Syscall registration helpers with resource allocation handling. | * Syscall registration helpers with resource allocation handling. | ||||
*/ | */ | ||||
struct syscall_helper_data { | struct syscall_helper_data { | ||||
struct sysent new_sysent; | struct sysent new_sysent; | ||||
struct sysent old_sysent; | struct sysent old_sysent; | ||||
int syscall_no; | int syscall_no; | ||||
int registered; | int registered; | ||||
}; | }; | ||||
#define SYSCALL_INIT_HELPER(syscallname) { \ | #define SYSCALL_INIT_HELPER_F(syscallname, flags) { \ | ||||
.new_sysent = { \ | .new_sysent = { \ | ||||
.sy_narg = (sizeof(struct syscallname ## _args ) \ | .sy_narg = (sizeof(struct syscallname ## _args ) \ | ||||
/ sizeof(register_t)), \ | / sizeof(register_t)), \ | ||||
.sy_call = (sy_call_t *)& sys_ ## syscallname, \ | .sy_call = (sy_call_t *)& sys_ ## syscallname, \ | ||||
.sy_auevent = SYS_AUE_##syscallname \ | .sy_auevent = SYS_AUE_##syscallname, \ | ||||
.sy_flags = (flags) \ | |||||
}, \ | }, \ | ||||
.syscall_no = SYS_##syscallname \ | .syscall_no = SYS_##syscallname \ | ||||
} | } | ||||
#define SYSCALL_INIT_HELPER_COMPAT(syscallname) { \ | #define SYSCALL_INIT_HELPER_COMPAT_F(syscallname, flags) { \ | ||||
.new_sysent = { \ | .new_sysent = { \ | ||||
.sy_narg = (sizeof(struct syscallname ## _args ) \ | .sy_narg = (sizeof(struct syscallname ## _args ) \ | ||||
/ sizeof(register_t)), \ | / sizeof(register_t)), \ | ||||
.sy_call = (sy_call_t *)& syscallname, \ | .sy_call = (sy_call_t *)& syscallname, \ | ||||
.sy_auevent = SYS_AUE_##syscallname \ | .sy_auevent = SYS_AUE_##syscallname, \ | ||||
.sy_flags = (flags) \ | |||||
}, \ | }, \ | ||||
.syscall_no = SYS_##syscallname \ | .syscall_no = SYS_##syscallname \ | ||||
} | } | ||||
#define SYSCALL_INIT_HELPER(syscallname) \ | |||||
SYSCALL_INIT_HELPER_F(syscallname, 0) | |||||
#define SYSCALL_INIT_HELPER_COMPAT(syscallname) \ | |||||
SYSCALL_INIT_HELPER_COMPAT_F(syscallname, 0) | |||||
#define SYSCALL_INIT_LAST { \ | #define SYSCALL_INIT_LAST { \ | ||||
.syscall_no = NO_SYSCALL \ | .syscall_no = NO_SYSCALL \ | ||||
} | } | ||||
int syscall_register(int *offset, struct sysent *new_sysent, | int syscall_register(int *offset, struct sysent *new_sysent, | ||||
struct sysent *old_sysent, int flags); | struct sysent *old_sysent, int flags); | ||||
int syscall_deregister(int *offset, struct sysent *old_sysent); | int syscall_deregister(int *offset, struct sysent *old_sysent); | ||||
int syscall_module_handler(struct module *mod, int what, void *arg); | int syscall_module_handler(struct module *mod, int what, void *arg); | ||||
Show All 28 Lines |