Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_common.c
Show All 28 Lines | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/exec.h> | #include <sys/exec.h> | ||||
#include <sys/imgact.h> | #include <sys/imgact.h> | ||||
#include <sys/imgact_elf.h> | #include <sys/imgact_elf.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mutex.h> | |||||
#include <sys/sx.h> | #include <sys/sx.h> | ||||
#include <compat/linux/linux.h> | #include <compat/linux/linux.h> | ||||
#include <compat/linux/linux_emul.h> | #include <compat/linux/linux_emul.h> | ||||
#include <compat/linux/linux_ioctl.h> | #include <compat/linux/linux_ioctl.h> | ||||
#include <compat/linux/linux_mib.h> | #include <compat/linux/linux_mib.h> | ||||
#include <compat/linux/linux_util.h> | #include <compat/linux/linux_util.h> | ||||
Show All 13 Lines | linux_common_modevent(module_t mod, int type, void *data) | ||||
case MOD_LOAD: | case MOD_LOAD: | ||||
#ifdef INVARIANTS | #ifdef INVARIANTS | ||||
linux_check_errtbl(); | linux_check_errtbl(); | ||||
#endif | #endif | ||||
linux_dev_shm_create(); | linux_dev_shm_create(); | ||||
linux_osd_jail_register(); | linux_osd_jail_register(); | ||||
SET_FOREACH(ldhp, linux_device_handler_set) | SET_FOREACH(ldhp, linux_device_handler_set) | ||||
linux_device_register_handler(*ldhp); | linux_device_register_handler(*ldhp); | ||||
LIST_INIT(&futex_list); | |||||
mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); | |||||
break; | break; | ||||
case MOD_UNLOAD: | case MOD_UNLOAD: | ||||
linux_dev_shm_destroy(); | linux_dev_shm_destroy(); | ||||
linux_osd_jail_deregister(); | linux_osd_jail_deregister(); | ||||
SET_FOREACH(ldhp, linux_device_handler_set) | SET_FOREACH(ldhp, linux_device_handler_set) | ||||
linux_device_unregister_handler(*ldhp); | linux_device_unregister_handler(*ldhp); | ||||
mtx_destroy(&futex_mtx); | |||||
break; | break; | ||||
default: | default: | ||||
return (EOPNOTSUPP); | return (EOPNOTSUPP); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static moduledata_t linux_common_mod = { | static moduledata_t linux_common_mod = { | ||||
"linux_common", | "linux_common", | ||||
linux_common_modevent, | linux_common_modevent, | ||||
0 | 0 | ||||
}; | }; | ||||
DECLARE_MODULE(linux_common, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); | DECLARE_MODULE(linux_common, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); | ||||
MODULE_VERSION(linux_common, 1); | MODULE_VERSION(linux_common, 1); |