Module Name: src Committed By: christos Date: Sun Jan 27 18:29:10 UTC 2019
Modified Files: src/sys/compat/common: kern_mod_80.c src/sys/kern: sys_module.c src/sys/sys: module.h Added Files: src/sys/compat/sys: module.h Log Message: - autoload the compat_80 for modstat - move compat struct to a compat header To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/kern_mod_80.c cvs rdiff -u -r0 -r1.1 src/sys/compat/sys/module.h cvs rdiff -u -r1.26 -r1.27 src/sys/kern/sys_module.c cvs rdiff -u -r1.43 -r1.44 src/sys/sys/module.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/compat/common/kern_mod_80.c diff -u src/sys/compat/common/kern_mod_80.c:1.2 src/sys/compat/common/kern_mod_80.c:1.3 --- src/sys/compat/common/kern_mod_80.c:1.2 Sat Jan 26 21:08:39 2019 +++ src/sys/compat/common/kern_mod_80.c Sun Jan 27 13:29:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_mod_80.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $ */ +/* $NetBSD: kern_mod_80.c,v 1.3 2019/01/27 18:29:10 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_mod_80.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_mod_80.c,v 1.3 2019/01/27 18:29:10 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_mod_80. #include <sys/syscall.h> #include <sys/syscallargs.h> #include <sys/compat_stub.h> +#include <sys/compat/module.h> #include <compat/common/compat_mod.h> Index: src/sys/kern/sys_module.c diff -u src/sys/kern/sys_module.c:1.26 src/sys/kern/sys_module.c:1.27 --- src/sys/kern/sys_module.c:1.26 Sat Jan 26 21:08:43 2019 +++ src/sys/kern/sys_module.c Sun Jan 27 13:29:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_module.c,v 1.26 2019/01/27 02:08:43 pgoyette Exp $ */ +/* $NetBSD: sys_module.c,v 1.27 2019/01/27 18:29:10 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.26 2019/01/27 02:08:43 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.27 2019/01/27 18:29:10 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_modular.h" @@ -325,7 +325,7 @@ sys_modctl(struct lwp *l, const struct s break; default: - + (void)module_autoload("compat_80", MODULE_CLASS_EXEC); MODULE_CALL_HOOK(compat_modstat_80_hook, (SCARG(uap, cmd), &iov, arg), enosys(), error); if (error == ENOSYS) Index: src/sys/sys/module.h diff -u src/sys/sys/module.h:1.43 src/sys/sys/module.h:1.44 --- src/sys/sys/module.h:1.43 Sat Jan 26 21:08:50 2019 +++ src/sys/sys/module.h Sun Jan 27 13:29:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: module.h,v 1.43 2019/01/27 02:08:50 pgoyette Exp $ */ +/* $NetBSD: module.h,v 1.44 2019/01/27 18:29:10 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -248,22 +248,6 @@ enum modctl { }; /* - * This structure intentionally has the same layout for 32 and 64 - * bit builds. - */ -typedef struct omodstat { - char oms_name[MAXMODNAME]; - char oms_required[MAXMODNAME * MAXMODDEPS]; - uint64_t oms_addr; - modsrc_t oms_source; - modclass_t oms_class; - u_int oms_size; - u_int oms_refcnt; - u_int oms_flags; - u_int oms_reserved[3]; -} omodstat_t; - -/* * This structure is used with the newer version of MODCTL_STAT, which * exports strings of arbitrary length for the list of required modules. */ Added files: Index: src/sys/compat/sys/module.h diff -u /dev/null src/sys/compat/sys/module.h:1.1 --- /dev/null Sun Jan 27 13:29:10 2019 +++ src/sys/compat/sys/module.h Sun Jan 27 13:29:10 2019 @@ -0,0 +1,48 @@ +/* $NetBSD: module.h,v 1.1 2019/01/27 18:29:10 christos Exp $ */ + +/*- + * Copyright (c) 2008 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYS_COMPAT_MODULE_H_ +#define _SYS_COMPAT_MODULE_H_ + +/* + * This structure intentionally has the same layout for 32 and 64 + * bit builds. + */ +typedef struct omodstat { + char oms_name[MAXMODNAME]; + char oms_required[MAXMODNAME * MAXMODDEPS]; + uint64_t oms_addr; + modsrc_t oms_source; + modclass_t oms_class; + u_int oms_size; + u_int oms_refcnt; + u_int oms_flags; + u_int oms_reserved[3]; +} omodstat_t; + +#endif /* !_SYS_COMPAT_MODULE_H_ */