Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys - autoload the compat_80 for modstat



details:   https://anonhg.NetBSD.org/src/rev/2814c02e7aff
branches:  trunk
changeset: 447902:2814c02e7aff
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 27 18:29:10 2019 +0000

description:
- autoload the compat_80 for modstat
- move compat struct to a compat header

diffstat:

 sys/compat/common/kern_mod_80.c |   5 ++-
 sys/compat/sys/module.h         |  48 +++++++++++++++++++++++++++++++++++++++++
 sys/kern/sys_module.c           |   6 ++--
 sys/sys/module.h                |  18 +--------------
 4 files changed, 55 insertions(+), 22 deletions(-)

diffs (137 lines):

diff -r 45f5a6f93bbd -r 2814c02e7aff sys/compat/common/kern_mod_80.c
--- a/sys/compat/common/kern_mod_80.c   Sun Jan 27 18:00:06 2019 +0000
+++ b/sys/compat/common/kern_mod_80.c   Sun Jan 27 18:29:10 2019 +0000
@@ -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 @@
 #include <sys/syscall.h>
 #include <sys/syscallargs.h>
 #include <sys/compat_stub.h>
+#include <sys/compat/module.h>
 
 #include <compat/common/compat_mod.h>
 
diff -r 45f5a6f93bbd -r 2814c02e7aff sys/compat/sys/module.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/sys/module.h   Sun Jan 27 18:29:10 2019 +0000
@@ -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_ */
diff -r 45f5a6f93bbd -r 2814c02e7aff sys/kern/sys_module.c
--- a/sys/kern/sys_module.c     Sun Jan 27 18:00:06 2019 +0000
+++ b/sys/kern/sys_module.c     Sun Jan 27 18:29:10 2019 +0000
@@ -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 @@
                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)
diff -r 45f5a6f93bbd -r 2814c02e7aff sys/sys/module.h
--- a/sys/sys/module.h  Sun Jan 27 18:00:06 2019 +0000
+++ b/sys/sys/module.h  Sun Jan 27 18:29:10 2019 +0000
@@ -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 @@
 };
 
 /*
- * 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.
  */



Home | Main Index | Thread Index | Old Index