Source-Changes-HG archive

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

[src/pgoyette-compat]: src Extract compat_14 stuff into its own module



details:   https://anonhg.NetBSD.org/src/rev/93f7824237f2
branches:  pgoyette-compat
changeset: 830541:93f7824237f2
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Mar 30 10:09:07 2018 +0000

description:
Extract compat_14 stuff into its own module

diffstat:

 distrib/sets/lists/modules/mi     |   4 +-
 sys/arch/amd64/amd64/locore.S     |   4 +-
 sys/arch/amd64/conf/GENERIC       |   6 +-
 sys/compat/common/compat_14_mod.c |  85 +++++++++++++++++++++++++++++++++++++++
 sys/compat/common/compat_mod.c    |   6 +-
 sys/compat/common/compat_mod.h    |   9 +++-
 sys/compat/common/files.common    |   3 +-
 sys/compat/common/rtsock_14.c     |  23 +++++++++-
 sys/kern/compat_stub.c            |   8 +++-
 sys/modules/Makefile              |   4 +-
 sys/modules/compat_14/Makefile    |  16 +++++++
 sys/net/rtsock.c                  |  18 ++++----
 sys/sys/compat_stub.h             |  13 +++++-
 13 files changed, 174 insertions(+), 25 deletions(-)

diffs (truncated from 424 to 300 lines):

diff -r 628dc8d8ef78 -r 93f7824237f2 distrib/sets/lists/modules/mi
--- a/distrib/sets/lists/modules/mi     Fri Mar 30 06:34:00 2018 +0000
+++ b/distrib/sets/lists/modules/mi     Fri Mar 30 10:09:07 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.114.2.10 2018/03/30 05:35:47 pgoyette Exp $
+# $NetBSD: mi,v 1.114.2.11 2018/03/30 10:09:07 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -68,6 +68,8 @@
 ./@MODULEDIR@/coda5/coda5.kmod                 base-kernel-modules     kmod
 ./@MODULEDIR@/compat                           base-kernel-modules     kmod
 ./@MODULEDIR@/compat/compat.kmod               base-kernel-modules     kmod
+./@MODULEDIR@/compat_14                                base-kernel-modules     kmod
+./@MODULEDIR@/compat_14/compat_14.kmod         base-kernel-modules     kmod
 ./@MODULEDIR@/compat_16                                base-kernel-modules     kmod
 ./@MODULEDIR@/compat_16/compat_16.kmod         base-kernel-modules     kmod
 ./@MODULEDIR@/compat_20                                base-kernel-modules     kmod
diff -r 628dc8d8ef78 -r 93f7824237f2 sys/arch/amd64/amd64/locore.S
--- a/sys/arch/amd64/amd64/locore.S     Fri Mar 30 06:34:00 2018 +0000
+++ b/sys/arch/amd64/amd64/locore.S     Fri Mar 30 10:09:07 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.157.2.2 2018/03/30 06:20:11 pgoyette Exp $        */
+/*     $NetBSD: locore.S,v 1.157.2.3 2018/03/30 10:09:07 pgoyette Exp $        */
 
 /*
  * Copyright-o-rama!
@@ -1102,9 +1102,11 @@
        movq    %r12,%rsi
 #endif
 
+#ifndef XEN
        pushq   %rdx
        callq   _C_LABEL(speculation_barrier)
        popq    %rdx
+#endif
 
        /* Switch to newlwp's stack. */
        movq    L_PCB(%r12),%r14
diff -r 628dc8d8ef78 -r 93f7824237f2 sys/arch/amd64/conf/GENERIC
--- a/sys/arch/amd64/conf/GENERIC       Fri Mar 30 06:34:00 2018 +0000
+++ b/sys/arch/amd64/conf/GENERIC       Fri Mar 30 10:09:07 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.485.2.2 2018/03/30 06:20:11 pgoyette Exp $
+# $NetBSD: GENERIC,v 1.485.2.3 2018/03/30 10:09:07 pgoyette Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident         "GENERIC-$Revision: 1.485.2.2 $"
+#ident         "GENERIC-$Revision: 1.485.2.3 $"
 
 maxusers       64              # estimated number of users
 
@@ -124,7 +124,7 @@
 # NetBSD backward compatibility. Support goes from COMPAT_15 up until
 # the latest release. Note that really old compat (< COMPAT_16) is only
 # useful for 32-bit i386 binaries.
-include        "conf/compat_netbsd15.config"
+include        "conf/compat_netbsd09.config"   # XXX PRG XXX usually 15
 
 #options       COMPAT_386BSD_MBRPART # recognize old partition ID
 
diff -r 628dc8d8ef78 -r 93f7824237f2 sys/compat/common/compat_14_mod.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/common/compat_14_mod.c Fri Mar 30 10:09:07 2018 +0000
@@ -0,0 +1,85 @@
+/*     $NetBSD: compat_14_mod.c,v 1.1.2.1 2018/03/30 10:09:07 pgoyette Exp $   */
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software developed for The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * 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.
+ */
+
+/*
+ * Linkage for the compat module: spaghetti.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: compat_14_mod.c,v 1.1.2.1 2018/03/30 10:09:07 pgoyette Exp $");
+
+#include <sys/systm.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+#include <sys/syscall.h>
+#include <sys/syscallvar.h>
+#include <sys/syscallargs.h>
+
+#include <compat/common/compat_util.h>
+#include <compat/common/compat_mod.h>
+
+int
+compat_14_init(void)
+{
+
+       rtsock_14_init();
+       return 0;
+}
+
+int
+compat_14_fini(void)
+{
+
+       rtsock_14_fini();
+       return 0;
+}
+
+#ifdef _MODULE
+
+#define REQD_14_1      "compat_80,compat_70,compat_60,compat_50,"
+#define REQD_14_2      "compat_40,compat_30,compat_20,compat_16"
+
+MODULE(MODULE_CLASS_EXEC, compat_14, REQD_14_1 REQD_14_2);
+
+static int
+compat_14_modcmd(modcmd_t cmd, void *arg)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+               return compat_14_init();
+       case MODULE_CMD_FINI:
+               return compat_14_init();
+       default:
+               return ENOTTY;
+       }
+}
+#endif
diff -r 628dc8d8ef78 -r 93f7824237f2 sys/compat/common/compat_mod.c
--- a/sys/compat/common/compat_mod.c    Fri Mar 30 06:34:00 2018 +0000
+++ b/sys/compat/common/compat_mod.c    Fri Mar 30 10:09:07 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_mod.c,v 1.24.14.26 2018/03/30 05:35:47 pgoyette Exp $   */
+/*     $NetBSD: compat_mod.c,v 1.24.14.27 2018/03/30 10:09:07 pgoyette Exp $   */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.26 2018/03/30 05:35:47 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.27 2018/03/30 10:09:07 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -177,10 +177,10 @@
 #ifdef COMPAT_16
        { compat_16_init, compat_16_fini },
 #endif
-#if 0  /* NOT YET */
 #ifdef COMPAT_14
        { compat_14_init, compat_14_fini },
 #endif
+#if 0  /* NOT YET */
 #ifdef COMPAT_13
        { compat_13_init, compat_13_fini },
 #endif
diff -r 628dc8d8ef78 -r 93f7824237f2 sys/compat/common/compat_mod.h
--- a/sys/compat/common/compat_mod.h    Fri Mar 30 06:34:00 2018 +0000
+++ b/sys/compat/common/compat_mod.h    Fri Mar 30 10:09:07 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_mod.h,v 1.1.42.14 2018/03/30 05:35:47 pgoyette Exp $    */
+/*     $NetBSD: compat_mod.h,v 1.1.42.15 2018/03/30 10:09:07 pgoyette Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -123,4 +123,11 @@
 int kern_sig_16_fini(void);
 #endif
 
+#ifdef COMPAT_14
+int compat_14_init(void);
+int compat_14_fini(void);
+void rtsock_14_init(void);
+void rtsock_14_fini(void);
+#endif
+
 #endif /* !_COMPAT_MOD_H_ */
diff -r 628dc8d8ef78 -r 93f7824237f2 sys/compat/common/files.common
--- a/sys/compat/common/files.common    Fri Mar 30 06:34:00 2018 +0000
+++ b/sys/compat/common/files.common    Fri Mar 30 10:09:07 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.common,v 1.1.2.26 2018/03/30 06:34:00 pgoyette Exp $
+#      $NetBSD: files.common,v 1.1.2.27 2018/03/30 10:09:07 pgoyette Exp $
 
 #
 # Generic files, used by all compat options.
@@ -38,6 +38,7 @@
 file   compat/common/uvm_13.c                  compat_13
 
 # Compatibility code for NetBSD 1.4
+file   compat/common/compat_14_mod.c           compat_14
 file   compat/common/rtsock_14.c               compat_14
 
 # Compatibility code for NetBSD 1.6
diff -r 628dc8d8ef78 -r 93f7824237f2 sys/compat/common/rtsock_14.c
--- a/sys/compat/common/rtsock_14.c     Fri Mar 30 06:34:00 2018 +0000
+++ b/sys/compat/common/rtsock_14.c     Fri Mar 30 10:09:07 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtsock_14.c,v 1.5 2016/11/03 03:37:06 riastradh Exp $  */
+/*     $NetBSD: rtsock_14.c,v 1.5.14.1 2018/03/30 10:09:07 pgoyette Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,v 1.5 2016/11/03 03:37:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,v 1.5.14.1 2018/03/30 10:09:07 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -77,6 +77,7 @@
 #include <sys/protosw.h>
 #include <sys/sysctl.h>
 #include <sys/kauth.h>
+#include <sys/compat_stub.h>
 #ifdef RTSOCK_DEBUG
 #include <netinet/in.h>
 #endif /* RTSOCK_DEBUG */
@@ -88,6 +89,8 @@
 #include <compat/net/if.h>
 #include <compat/net/route.h>
 
+#include <compat/common/compat_mod.h>
+
 void
 compat_14_rt_oifmsg(struct ifnet *ifp)
 {
@@ -165,3 +168,19 @@
        w->w_where = (char *)w->w_where + len;
        return 0;
 }
+
+void
+rtsock_14_init(void)
+{
+
+       rtsock14_oifmsg = compat_14_rt_oifmsg;
+       rtsock14_iflist = compat_14_iflist;
+}
+
+void
+rtsock_14_fini(void)
+{
+
+       rtsock14_oifmsg = (void *)voidop;
+       rtsock14_iflist = (void *)enosys;
+}
diff -r 628dc8d8ef78 -r 93f7824237f2 sys/kern/compat_stub.c
--- a/sys/kern/compat_stub.c    Fri Mar 30 06:34:00 2018 +0000
+++ b/sys/kern/compat_stub.c    Fri Mar 30 10:09:07 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.c,v 1.1.2.12 2018/03/30 02:28:49 pgoyette Exp $        */
+/* $NetBSD: compat_stub.c,v 1.1.2.13 2018/03/30 10:09:08 pgoyette Exp $        */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -142,3 +142,9 @@
 
 int (*if43_20_cvtcmd)(int) = (void *)enosys;
 
+/*
+ * rtsock 14 compatability
+ */
+void (*rtsock14_oifmsg)(struct ifnet *) = (void *)voidop;
+int (*rtsock14_iflist)(struct ifnet *, struct rt_walkarg *,
+    struct rt_addrinfo *, size_t) = (void *)enosys;
diff -r 628dc8d8ef78 -r 93f7824237f2 sys/modules/Makefile
--- a/sys/modules/Makefile      Fri Mar 30 06:34:00 2018 +0000
+++ b/sys/modules/Makefile      Fri Mar 30 10:09:07 2018 +0000



Home | Main Index | Thread Index | Old Index