diff options
author | dchagin <dchagin@FreeBSD.org> | 2016-01-09 16:11:09 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2016-01-09 16:11:09 +0000 |
commit | 6c12e20ac1e5ea5573246049365409feabb20095 (patch) | |
tree | faa5068ff72fa5ba5e4a549a627a6eb1509ad298 /sys/compat/linux/linux_common.c | |
parent | d30e84112a87337209ea45237f3d9b12e29abaa9 (diff) | |
download | FreeBSD-src-6c12e20ac1e5ea5573246049365409feabb20095.zip FreeBSD-src-6c12e20ac1e5ea5573246049365409feabb20095.tar.gz |
MFC r283422:
Refund the proc emuldata struct for future use. For now move flags from
thread emuldata to proc emuldata as it was originally intended.
As we can have both 64 & 32 bit Linuxulator running any eventhandler
can be called twice for us. To prevent this move eventhandlers code
from linux_emul.c to the linux_common.ko module.
Diffstat (limited to 'sys/compat/linux/linux_common.c')
-rw-r--r-- | sys/compat/linux/linux_common.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index 5427b61..3cee92a 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -28,13 +28,15 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> -#include <sys/module.h> -#include <sys/malloc.h> -#include <sys/module.h> -#include <sys/types.h> +#include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> +#include <sys/imgact_elf.h> #include <sys/kernel.h> -#include <sys/proc.h> +#include <sys/malloc.h> +#include <sys/eventhandler.h> +#include <compat/linux/linux_emul.h> #include <compat/linux/linux_mib.h> #include <compat/linux/linux_util.h> @@ -42,6 +44,10 @@ MODULE_VERSION(linux_common, 1); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); +static eventhandler_tag linux_exec_tag; +static eventhandler_tag linux_thread_dtor_tag; +static eventhandler_tag linux_exit_tag; + static int linux_common_modevent(module_t mod, int type, void *data) @@ -51,6 +57,12 @@ linux_common_modevent(module_t mod, int type, void *data) switch(type) { case MOD_LOAD: linux_osd_jail_register(); + linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, + linux_proc_exit, NULL, 1000); + linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, + linux_proc_exec, NULL, 1000); + linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, + linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_register_handler(*ldhp); break; @@ -58,6 +70,9 @@ linux_common_modevent(module_t mod, int type, void *data) linux_osd_jail_deregister(); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_unregister_handler(*ldhp); + EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); + EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); + EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); break; default: return (EOPNOTSUPP); |