From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 06:08:33 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82389A0D; Fri, 7 Nov 2014 06:08:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63040D1C; Fri, 7 Nov 2014 06:08:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA768XJH027183; Fri, 7 Nov 2014 06:08:33 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA768WvE027178; Fri, 7 Nov 2014 06:08:32 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411070608.sA768WvE027178@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 06:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274219 - in user/dchagin/lemul/sys: amd64/linux amd64/linux32 compat/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 06:08:33 -0000 Author: dchagin Date: Fri Nov 7 06:08:32 2014 New Revision: 274219 URL: https://svnweb.freebsd.org/changeset/base/274219 Log: Move device handler to common module (after r268138). Modified: user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c user/dchagin/lemul/sys/compat/linux/linux_common.c Modified: user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c Fri Nov 7 04:47:46 2014 (r274218) +++ user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c Fri Nov 7 06:08:32 2014 (r274219) @@ -117,7 +117,6 @@ extern char _binary_linux_locore_o_end; extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -SET_DECLARE(linux_device_handler_set, struct linux_device_handler); static register_t * linux_copyout_strings(struct image_params *imgp); static int elf_linux_fixup(register_t **stack_base, @@ -944,7 +943,6 @@ linux64_elf_modevent(module_t mod, int t Elf64_Brandinfo **brandinfo; int error; struct linux_ioctl_handler **lihp; - struct linux_device_handler **ldhp; error = 0; @@ -957,8 +955,6 @@ linux64_elf_modevent(module_t mod, int t if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_register_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_register_handler(*ldhp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk64", NULL, MTX_DEF); stclohz = (stathz ? stathz : hz); @@ -981,8 +977,6 @@ linux64_elf_modevent(module_t mod, int t if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_unregister_handler(*ldhp); mtx_destroy(&futex_mtx); if (bootverbose) printf("Linux ELF exec handler removed\n"); Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c Fri Nov 7 04:47:46 2014 (r274218) +++ user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c Fri Nov 7 06:08:32 2014 (r274219) @@ -118,7 +118,6 @@ extern char _binary_linux32_locore_o_end extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -SET_DECLARE(linux_device_handler_set, struct linux_device_handler); static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); @@ -1154,7 +1153,6 @@ linux_elf_modevent(module_t mod, int typ Elf32_Brandinfo **brandinfo; int error; struct linux_ioctl_handler **lihp; - struct linux_device_handler **ldhp; error = 0; @@ -1167,8 +1165,6 @@ linux_elf_modevent(module_t mod, int typ if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_register_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_register_handler(*ldhp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); stclohz = (stathz ? stathz : hz); @@ -1191,8 +1187,6 @@ linux_elf_modevent(module_t mod, int typ if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_unregister_handler(*ldhp); mtx_destroy(&futex_mtx); if (bootverbose) printf("Linux ELF exec handler removed\n"); Modified: user/dchagin/lemul/sys/compat/linux/linux_common.c ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_common.c Fri Nov 7 04:47:46 2014 (r274218) +++ user/dchagin/lemul/sys/compat/linux/linux_common.c Fri Nov 7 06:08:32 2014 (r274219) @@ -38,9 +38,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include 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; @@ -50,6 +52,7 @@ static eventhandler_tag linux_exit_tag; static int linux_common_modevent(module_t mod, int type, void *data) { + struct linux_device_handler **ldhp; switch(type) { case MOD_LOAD: @@ -60,9 +63,13 @@ linux_common_modevent(module_t mod, int 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; case MOD_UNLOAD: 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);