Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Create compat_100 module infrastructure now that we have...
details: https://anonhg.NetBSD.org/src/rev/28f1660f5327
branches: trunk
changeset: 372678:28f1660f5327
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Mon Dec 19 23:19:51 2022 +0000
description:
Create compat_100 module infrastructure now that we have branched
for NetBSD-10
diffstat:
sys/compat/common/compat_100_mod.c | 79 +++++++++++++++++++++++++++++++
sys/compat/common/compat_90_mod.c | 6 +-
sys/compat/common/compat_mod.h | 7 ++-
sys/compat/common/files.common | 5 +-
sys/compat/netbsd32/files.netbsd32 | 3 +-
sys/compat/netbsd32/netbsd32_compat_100.c | 58 ++++++++++++++++++++++
sys/compat/netbsd32/syscalls.conf | 4 +-
sys/conf/compat_netbsd100.config | 9 +++
sys/conf/files | 5 +-
sys/modules/Makefile | 6 +-
sys/modules/compat_100/Makefile | 13 +++++
sys/modules/compat_netbsd32_100/Makefile | 15 +++++
12 files changed, 197 insertions(+), 13 deletions(-)
diffs (truncated from 339 to 300 lines):
diff -r c101ce7e5f42 -r 28f1660f5327 sys/compat/common/compat_100_mod.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/common/compat_100_mod.c Mon Dec 19 23:19:51 2022 +0000
@@ -0,0 +1,79 @@
+/* $NetBSD: compat_100_mod.c,v 1.1 2022/12/19 23:19:51 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2019 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.
+ */
+
+#if defined(_KERNEL_OPT)
+#include "opt_compat_netbsd.h"
+#endif
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: compat_100_mod.c,v 1.1 2022/12/19 23:19:51 pgoyette Exp $");
+
+#include <sys/systm.h>
+#include <sys/module.h>
+
+#include <compat/common/compat_util.h>
+#include <compat/common/compat_mod.h>
+
+int
+compat_100_init(void)
+{
+
+ return 0;
+}
+
+int
+compat_100_fini(void)
+{
+
+ return 0;
+}
+
+MODULE(MODULE_CLASS_EXEC, compat_100, NULL);
+
+static int
+compat_100_modcmd(modcmd_t cmd, void *arg)
+{
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ return compat_100_init();
+
+ case MODULE_CMD_FINI:
+ return compat_100_fini();
+
+ default:
+ return ENOTTY;
+ }
+}
diff -r c101ce7e5f42 -r 28f1660f5327 sys/compat/common/compat_90_mod.c
--- a/sys/compat/common/compat_90_mod.c Mon Dec 19 21:13:16 2022 +0000
+++ b/sys/compat/common/compat_90_mod.c Mon Dec 19 23:19:51 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_90_mod.c,v 1.3 2020/01/04 02:40:22 pgoyette Exp $ */
+/* $NetBSD: compat_90_mod.c,v 1.4 2022/12/19 23:19:51 pgoyette Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.3 2020/01/04 02:40:22 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.4 2022/12/19 23:19:51 pgoyette Exp $");
#include <sys/systm.h>
#include <sys/module.h>
@@ -60,7 +60,7 @@
return vfs_syscalls_90_fini();
}
-MODULE(MODULE_CLASS_EXEC, compat_90, NULL);
+MODULE(MODULE_CLASS_EXEC, compat_90, "compat_100");
static int
compat_90_modcmd(modcmd_t cmd, void *arg)
diff -r c101ce7e5f42 -r 28f1660f5327 sys/compat/common/compat_mod.h
--- a/sys/compat/common/compat_mod.h Mon Dec 19 21:13:16 2022 +0000
+++ b/sys/compat/common/compat_mod.h Mon Dec 19 23:19:51 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_mod.h,v 1.6 2019/09/22 22:59:38 christos Exp $ */
+/* $NetBSD: compat_mod.h,v 1.7 2022/12/19 23:19:51 pgoyette Exp $ */
/*-
* Copyright (c) 2013, 2019 The NetBSD Foundation, Inc.
@@ -32,6 +32,11 @@
#ifndef _COMPAT_MOD_H
#define _COMPAT_MOD_H
+#ifdef COMPAT_100
+int compat_100_init(void);
+int compat_100_fini(void);
+#endif
+
#ifdef COMPAT_90
int compat_90_init(void);
int compat_90_fini(void);
diff -r c101ce7e5f42 -r 28f1660f5327 sys/compat/common/files.common
--- a/sys/compat/common/files.common Mon Dec 19 21:13:16 2022 +0000
+++ b/sys/compat/common/files.common Mon Dec 19 23:19:51 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.common,v 1.7 2021/08/09 20:49:09 andvar Exp $
+# $NetBSD: files.common,v 1.8 2022/12/19 23:19:51 pgoyette Exp $
#
# Generic utility files, used by various compat options.
@@ -110,6 +110,9 @@
file compat/common/compat_90_mod.c compat_90
file compat/common/vfs_syscalls_90.c compat_90
+# Compatibility code for NetBSD 10.0
+file compat/common/compat_100_mod.c compat_100
+
#
# Sources for sysv ipc compatibility across the versions.
#
diff -r c101ce7e5f42 -r 28f1660f5327 sys/compat/netbsd32/files.netbsd32
--- a/sys/compat/netbsd32/files.netbsd32 Mon Dec 19 21:13:16 2022 +0000
+++ b/sys/compat/netbsd32/files.netbsd32 Mon Dec 19 23:19:51 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.netbsd32,v 1.53 2021/04/17 03:57:42 simonb Exp $
+# $NetBSD: files.netbsd32,v 1.54 2022/12/19 23:19:51 pgoyette Exp $
#
# config file description for machine-independent netbsd32 compat code.
# included by ports that need it.
@@ -64,3 +64,4 @@
file compat/netbsd32/netbsd32_compat_60.c compat_netbsd32 & compat_60
file compat/netbsd32/netbsd32_compat_80.c compat_netbsd32 & compat_80
file compat/netbsd32/netbsd32_compat_90.c compat_netbsd32 & compat_90
+file compat/netbsd32/netbsd32_compat_100.c compat_netbsd32 & compat_100
diff -r c101ce7e5f42 -r 28f1660f5327 sys/compat/netbsd32/netbsd32_compat_100.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_100.c Mon Dec 19 23:19:51 2022 +0000
@@ -0,0 +1,58 @@
+/* $NetBSD: netbsd32_compat_100.c,v 1.1 2022/12/19 23:19:51 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2019 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software developed for The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.1 2022/12/19 23:19:51 pgoyette Exp $");
+
+#include <sys/module.h>
+
+#include <compat/netbsd32/netbsd32.h>
+#include <compat/netbsd32/netbsd32_syscall.h>
+#include <compat/netbsd32/netbsd32_syscallargs.h>
+#include <compat/netbsd32/netbsd32_conv.h>
+
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_100, "compat_netbsd32,compat_100");
+
+static int
+compat_netbsd32_100_modcmd(modcmd_t cmd, void *arg)
+{
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ return 0;
+
+ case MODULE_CMD_FINI:
+ return 0;
+
+ default:
+ return ENOTTY;
+ }
+}
diff -r c101ce7e5f42 -r 28f1660f5327 sys/compat/netbsd32/syscalls.conf
--- a/sys/compat/netbsd32/syscalls.conf Mon Dec 19 21:13:16 2022 +0000
+++ b/sys/compat/netbsd32/syscalls.conf Mon Dec 19 23:19:51 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: syscalls.conf,v 1.17 2019/09/22 22:59:38 christos Exp $
+# $NetBSD: syscalls.conf,v 1.18 2022/12/19 23:19:51 pgoyette Exp $
sysnames="netbsd32_syscalls.c"
sysnumhdr="netbsd32_syscall.h"
@@ -6,7 +6,7 @@
sysarghdr="netbsd32_syscallargs.h"
systrace="netbsd32_systrace_args.c"
sysautoload="netbsd32_syscalls_autoload.c"
-compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70 compat_80 compat_90"
+compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60 compat_70 compat_80 compat_90 compat_100"
libcompatopts=""
switchname="netbsd32_sysent"
diff -r c101ce7e5f42 -r 28f1660f5327 sys/conf/compat_netbsd100.config
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/conf/compat_netbsd100.config Mon Dec 19 23:19:51 2022 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: compat_netbsd100.config,v 1.1 2022/12/19 23:19:51 pgoyette Exp $
+
+# Common fragment for all NetBSD targets wanting NetBSD 10.0 and newer
+# compatibility support.
+#
+# Note that COMPAT_100 implies all newer COMPAT_XX options.
+
+include "conf/compat_netbsd.config"
+options COMPAT_100 # NetBSD 10.0 and beyond.
diff -r c101ce7e5f42 -r 28f1660f5327 sys/conf/files
--- a/sys/conf/files Mon Dec 19 21:13:16 2022 +0000
+++ b/sys/conf/files Mon Dec 19 23:19:51 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.1304 2022/12/03 01:04:42 brad Exp $
+# $NetBSD: files,v 1.1305 2022/12/19 23:19:51 pgoyette Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20171118
@@ -149,7 +149,8 @@
# compatibility options
#
defflag opt_compat_netbsd.h COMPAT_NETBSD
-defflag opt_compat_netbsd.h COMPAT_90: COMPAT_NETBSD
+defflag opt_compat_netbsd.h COMPAT_100: COMPAT_NETBSD
+defflag opt_compat_netbsd.h COMPAT_90: COMPAT_100, COMPAT_NETBSD
defflag opt_compat_netbsd.h COMPAT_80: COMPAT_90, COMPAT_NETBSD
defflag opt_compat_netbsd.h COMPAT_70: COMPAT_80, COMPAT_NETBSD
defflag opt_compat_netbsd.h COMPAT_60: COMPAT_70, COMPAT_NETBSD
diff -r c101ce7e5f42 -r 28f1660f5327 sys/modules/Makefile
--- a/sys/modules/Makefile Mon Dec 19 21:13:16 2022 +0000
+++ b/sys/modules/Makefile Mon Dec 19 23:19:51 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.274 2022/12/03 01:04:42 brad Exp $
+# $NetBSD: Makefile,v 1.275 2022/12/19 23:19:51 pgoyette Exp $
.include <bsd.own.mk>
@@ -10,7 +10,7 @@
SUBDIR+= compat_43 compat_sysctl_09_43
SUBDIR+= compat_09 compat_10 compat_12 compat_13 compat_14
SUBDIR+= compat_16 compat_20 compat_30 compat_40 compat_50
-SUBDIR+= compat_60 compat_70 compat_80 compat_90
+SUBDIR+= compat_60 compat_70 compat_80 compat_90 compat_100
SUBDIR+= compat_sysv_10 compat_sysv_14 compat_sysv_50
@@ -313,7 +313,7 @@
SUBDIR+= compat_netbsd32_20 compat_netbsd32_30
SUBDIR+= compat_netbsd32_40 compat_netbsd32_50
SUBDIR+= compat_netbsd32_60 compat_netbsd32_80
-SUBDIR+= compat_netbsd32_90
+SUBDIR+= compat_netbsd32_90 compat_netbsd32_100
Home |
Main Index |
Thread Index |
Old Index