Module Name: src
Committed By: pgoyette
Date: Fri Mar 30 10:09:08 UTC 2018
Modified Files:
src/distrib/sets/lists/modules [pgoyette-compat]: mi
src/sys/arch/amd64/amd64 [pgoyette-compat]: locore.S
src/sys/arch/amd64/conf [pgoyette-compat]: GENERIC
src/sys/compat/common [pgoyette-compat]: compat_mod.c compat_mod.h
files.common rtsock_14.c
src/sys/kern [pgoyette-compat]: compat_stub.c
src/sys/modules [pgoyette-compat]: Makefile
src/sys/net [pgoyette-compat]: rtsock.c
src/sys/sys [pgoyette-compat]: compat_stub.h
Added Files:
src/sys/compat/common [pgoyette-compat]: compat_14_mod.c
src/sys/modules/compat_14 [pgoyette-compat]: Makefile
Log Message:
Extract compat_14 stuff into its own module
To generate a diff of this commit:
cvs rdiff -u -r1.114.2.10 -r1.114.2.11 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.157.2.2 -r1.157.2.3 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.485.2.2 -r1.485.2.3 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r0 -r1.1.2.1 src/sys/compat/common/compat_14_mod.c
cvs rdiff -u -r1.24.14.26 -r1.24.14.27 src/sys/compat/common/compat_mod.c
cvs rdiff -u -r1.1.42.14 -r1.1.42.15 src/sys/compat/common/compat_mod.h
cvs rdiff -u -r1.1.2.26 -r1.1.2.27 src/sys/compat/common/files.common
cvs rdiff -u -r1.5 -r1.5.14.1 src/sys/compat/common/rtsock_14.c
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.202.2.14 -r1.202.2.15 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1.2.1 src/sys/modules/compat_14/Makefile
cvs rdiff -u -r1.238.2.2 -r1.238.2.3 src/sys/net/rtsock.c
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/sys/sys/compat_stub.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.114.2.10 src/distrib/sets/lists/modules/mi:1.114.2.11
--- src/distrib/sets/lists/modules/mi:1.114.2.10 Fri Mar 30 05:35:47 2018
+++ src/distrib/sets/lists/modules/mi Fri Mar 30 10:09:07 2018
@@ -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
Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.157.2.2 src/sys/arch/amd64/amd64/locore.S:1.157.2.3
--- src/sys/arch/amd64/amd64/locore.S:1.157.2.2 Fri Mar 30 06:20:11 2018
+++ src/sys/arch/amd64/amd64/locore.S Fri Mar 30 10:09:07 2018
@@ -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 @@ ENTRY(cpu_switchto)
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
Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.485.2.2 src/sys/arch/amd64/conf/GENERIC:1.485.2.3
--- src/sys/arch/amd64/conf/GENERIC:1.485.2.2 Fri Mar 30 06:20:11 2018
+++ src/sys/arch/amd64/conf/GENERIC Fri Mar 30 10:09:07 2018
@@ -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 @@ include "arch/amd64/conf/std.amd64"
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 @@ options KDTRACE_HOOKS # kernel DTrace h
# 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
Index: src/sys/compat/common/compat_mod.c
diff -u src/sys/compat/common/compat_mod.c:1.24.14.26 src/sys/compat/common/compat_mod.c:1.24.14.27
--- src/sys/compat/common/compat_mod.c:1.24.14.26 Fri Mar 30 05:35:47 2018
+++ src/sys/compat/common/compat_mod.c Fri Mar 30 10:09:07 2018
@@ -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 @@ struct compat_init_fini {
#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
Index: src/sys/compat/common/compat_mod.h
diff -u src/sys/compat/common/compat_mod.h:1.1.42.14 src/sys/compat/common/compat_mod.h:1.1.42.15
--- src/sys/compat/common/compat_mod.h:1.1.42.14 Fri Mar 30 05:35:47 2018
+++ src/sys/compat/common/compat_mod.h Fri Mar 30 10:09:07 2018
@@ -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_init(void);
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_ */
Index: src/sys/compat/common/files.common
diff -u src/sys/compat/common/files.common:1.1.2.26 src/sys/compat/common/files.common:1.1.2.27
--- src/sys/compat/common/files.common:1.1.2.26 Fri Mar 30 06:34:00 2018
+++ src/sys/compat/common/files.common Fri Mar 30 10:09:07 2018
@@ -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/kern_sig_13.c compat
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
Index: src/sys/compat/common/rtsock_14.c
diff -u src/sys/compat/common/rtsock_14.c:1.5 src/sys/compat/common/rtsock_14.c:1.5.14.1
--- src/sys/compat/common/rtsock_14.c:1.5 Thu Nov 3 03:37:06 2016
+++ src/sys/compat/common/rtsock_14.c Fri Mar 30 10:09:07 2018
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,
#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 @@ __KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,
#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 @@ compat_14_iflist(struct ifnet *ifp, stru
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;
+}
Index: src/sys/kern/compat_stub.c
diff -u src/sys/kern/compat_stub.c:1.1.2.12 src/sys/kern/compat_stub.c:1.1.2.13
--- src/sys/kern/compat_stub.c:1.1.2.12 Fri Mar 30 02:28:49 2018
+++ src/sys/kern/compat_stub.c Fri Mar 30 10:09:08 2018
@@ -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 (*ieee80211_get_ostats_20)(struct ie
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;
Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.202.2.14 src/sys/modules/Makefile:1.202.2.15
--- src/sys/modules/Makefile:1.202.2.14 Fri Mar 30 05:35:47 2018
+++ src/sys/modules/Makefile Fri Mar 30 10:09:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.202.2.14 2018/03/30 05:35:47 pgoyette Exp $
+# $NetBSD: Makefile,v 1.202.2.15 2018/03/30 10:09:08 pgoyette Exp $
.include <bsd.own.mk>
@@ -7,7 +7,7 @@
# Modules for compatability with earlier versions of NetBSD
SUBDIR+= compat compat_80 compat_70 compat_60 compat_50
-SUBDIR+= compat_40 compat_30 compat_20 compat_16 #compat_14
+SUBDIR+= compat_40 compat_30 compat_20 compat_16 compat_14
#SUBDIR+= compat_13 compat_12 compat_10 compat_09
SUBDIR+= compat_ossaudio
SUBDIR+= compat_sysv
Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.238.2.2 src/sys/net/rtsock.c:1.238.2.3
--- src/sys/net/rtsock.c:1.238.2.2 Thu Mar 22 01:44:51 2018
+++ src/sys/net/rtsock.c Fri Mar 30 10:09:08 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: rtsock.c,v 1.238.2.2 2018/03/22 01:44:51 pgoyette Exp $ */
+/* $NetBSD: rtsock.c,v 1.238.2.3 2018/03/30 10:09:08 pgoyette Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.238.2.2 2018/03/22 01:44:51 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.238.2.3 2018/03/30 10:09:08 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -83,6 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1
#include <sys/kmem.h>
#include <sys/intr.h>
#include <sys/condvar.h>
+#include <sys/compat_stub.h>
#include <net/if.h>
#include <net/if_llatbl.h>
@@ -1524,9 +1525,7 @@ COMPATNAME(rt_ifmsg)(struct ifnet *ifp)
if (m == NULL)
return;
COMPATNAME(route_enqueue)(m, 0);
-#ifdef COMPAT_14
- compat_14_rt_oifmsg(ifp);
-#endif
+ (*rtsock14_oifmsg)(ifp);
#ifdef COMPAT_50
compat_50_rt_oifmsg(ifp);
#endif
@@ -1892,12 +1891,10 @@ sysctl_iflist(int af, struct rt_walkarg
cmd = RTM_IFINFO;
iflist_if = sysctl_iflist_if;
break;
-#ifdef COMPAT_14
case NET_RT_OOOIFLIST:
cmd = RTM_OOIFINFO;
- iflist_if = compat_14_iflist;
+ iflist_if = rtsock14_iflist;
break;
-#endif
#ifdef COMPAT_50
case NET_RT_OOIFLIST:
cmd = RTM_OIFINFO;
@@ -1936,8 +1933,11 @@ sysctl_iflist(int af, struct rt_walkarg
goto release_exit;
info.rti_info[RTAX_IFP] = NULL;
if (w->w_where && w->w_tmem && w->w_needed <= 0) {
- if ((error = iflist_if(ifp, w, &info, len)) != 0)
+ if ((error = iflist_if(ifp, w, &info, len)) != 0) {
+ if (error == ENOSYS)
+ error = EINVAL;
goto release_exit;
+ }
}
_s = pserialize_read_enter();
IFADDR_READER_FOREACH(ifa, ifp) {
Index: src/sys/sys/compat_stub.h
diff -u src/sys/sys/compat_stub.h:1.1.2.12 src/sys/sys/compat_stub.h:1.1.2.13
--- src/sys/sys/compat_stub.h:1.1.2.12 Fri Mar 30 02:28:49 2018
+++ src/sys/sys/compat_stub.h Fri Mar 30 10:09:08 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.h,v 1.1.2.12 2018/03/30 02:28:49 pgoyette Exp $ */
+/* $NetBSD: compat_stub.h,v 1.1.2.13 2018/03/30 10:09:08 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -160,4 +160,15 @@ extern int (*ieee80211_get_ostats_20)(st
extern int (*if43_20_cvtcmd)(int);
+/*
+ * rtsock 14 compatability
+ */
+struct ifnet;
+struct rt_walkarg;
+struct rt_addrinfo;
+
+extern void (*rtsock14_oifmsg)(struct ifnet *);
+extern int (*rtsock14_iflist)(struct ifnet *, struct rt_walkarg *,
+ struct rt_addrinfo *, size_t);
+
#endif /* _SYS_COMPAT_STUB_H */
Added files:
Index: src/sys/compat/common/compat_14_mod.c
diff -u /dev/null src/sys/compat/common/compat_14_mod.c:1.1.2.1
--- /dev/null Fri Mar 30 10:09:08 2018
+++ src/sys/compat/common/compat_14_mod.c Fri Mar 30 10:09:07 2018
@@ -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
Index: src/sys/modules/compat_14/Makefile
diff -u /dev/null src/sys/modules/compat_14/Makefile:1.1.2.1
--- /dev/null Fri Mar 30 10:09:08 2018
+++ src/sys/modules/compat_14/Makefile Fri Mar 30 10:09:08 2018
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile,v 1.1.2.1 2018/03/30 10:09:08 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/compat/common
+
+KMOD= compat_14
+
+CPPFLAGS+= -DCOMPAT_14 -DCOMPAT_16 -DCOMPAT_20 -DCOMPAT_30
+CPPFLAGS+= -DCOMPAT_40 -DCOMPAT_50 -DCOMPAT_60 -DCOMPAT_70 -DCOMPAT_80
+
+SRCS+= compat_14_mod.c
+SRCS+= rtsock_14.c
+
+
+.include <bsd.kmodule.mk>