summaryrefslogtreecommitdiffstats
path: root/sys/sys/sysent.h
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2014-10-26 19:42:44 +0000
committermjg <mjg@FreeBSD.org>2014-10-26 19:42:44 +0000
commita9faac8f4b75a3a8c3d752a2c56e3709438f5a94 (patch)
treedab547b54bf840f54b99e4b2af2ddd062990face /sys/sys/sysent.h
parent4ee18dab174120853a3d2d38c7745f4b1489ae7b (diff)
downloadFreeBSD-src-a9faac8f4b75a3a8c3d752a2c56e3709438f5a94.zip
FreeBSD-src-a9faac8f4b75a3a8c3d752a2c56e3709438f5a94.tar.gz
Avoid dynamic syscall overhead for statically compiled modules.
The kernel tracks syscall users so that modules can safely unregister them. But if the module is not unloadable or was compiled into the kernel, there is no need to do this. Achieve this by adding SY_THR_STATIC_KLD macro which expands to SY_THR_STATIC during kernel build and 0 otherwise. Reviewed by: kib (previous version) MFC after: 2 weeks
Diffstat (limited to 'sys/sys/sysent.h')
-rw-r--r--sys/sys/sysent.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index 0f1c256..dabc8e8 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -76,6 +76,12 @@ struct sysent { /* system call table */
#define SY_THR_ABSENT 0x4
#define SY_THR_INCR 0x8
+#ifdef KLD_MODULE
+#define SY_THR_STATIC_KLD 0
+#else
+#define SY_THR_STATIC_KLD SY_THR_STATIC
+#endif
+
struct image_params;
struct __sigset;
struct syscall_args;
@@ -242,10 +248,10 @@ struct syscall_helper_data {
}
int syscall_register(int *offset, struct sysent *new_sysent,
- struct sysent *old_sysent);
+ struct sysent *old_sysent, int flags);
int syscall_deregister(int *offset, struct sysent *old_sysent);
int syscall_module_handler(struct module *mod, int what, void *arg);
-int syscall_helper_register(struct syscall_helper_data *sd);
+int syscall_helper_register(struct syscall_helper_data *sd, int flags);
int syscall_helper_unregister(struct syscall_helper_data *sd);
struct proc;
OpenPOWER on IntegriCloud