Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys Rename sysv_mod.[ch] to compat_sysv_mod.[ch] f...
details: https://anonhg.NetBSD.org/src/rev/dda6c4dfcb64
branches: pgoyette-compat
changeset: 321159:dda6c4dfcb64
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Tue Apr 17 21:59:27 2018 +0000
description:
Rename sysv_mod.[ch] to compat_sysv_mod.[ch] for consistency with other
files that provide module(7) interfaces.
diffstat:
sys/compat/common/compat_sysv_mod.c | 127 ++++++++++++++++++++++++++++++++++++
sys/compat/common/compat_sysv_mod.h | 41 +++++++++++
sys/compat/common/files.common | 4 +-
sys/compat/common/sysv_mod.c | 127 ------------------------------------
sys/compat/common/sysv_mod.h | 41 -----------
sys/kern/sysv_ipc.c | 6 +-
6 files changed, 173 insertions(+), 173 deletions(-)
diffs (truncated from 397 to 300 lines):
diff -r 1e4b157b1230 -r dda6c4dfcb64 sys/compat/common/compat_sysv_mod.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/common/compat_sysv_mod.c Tue Apr 17 21:59:27 2018 +0000
@@ -0,0 +1,127 @@
+/* $NetBSD: compat_sysv_mod.c,v 1.4.10.1 2018/04/17 21:59:27 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.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: compat_sysv_mod.c,v 1.4.10.1 2018/04/17 21:59:27 pgoyette Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_compat_netbsd.h"
+#include "opt_sysv.h"
+#endif
+
+#include <sys/systm.h>
+#include <sys/module.h>
+#include <sys/syscall.h>
+#include <sys/syscallargs.h>
+#include <sys/syscallvar.h>
+#include <sys/sysctl.h>
+
+#include <compat/common/compat_sysv_mod.h>
+
+MODULE(MODULE_CLASS_EXEC, compat_sysv, "sysv_ipc");
+
+/* Build the syscall package based on options specified */
+
+static const struct syscall_package compat_syscalls[] = {
+#if defined(COMPAT_10) && !defined(_LP64)
+#ifdef SYSVSHM
+ { SYS_compat_10_oshmsys, 0, (sy_call_t *)compat_10_sys_shmsys },
+#endif
+#ifdef SYSVSEM
+ { SYS_compat_10_osemsys, 0, (sy_call_t *)compat_10_sys_semsys },
+#endif
+#ifdef SYSVMSG
+ { SYS_compat_10_omsgsys, 0, (sy_call_t *)compat_10_sys_msgsys },
+#endif
+#endif /* defined(COMPAT_10) && !defined(_LP64) */
+
+#if defined(COMPAT_14)
+#ifdef SYSVSHM
+ { SYS_compat_14_shmctl, 0, (sy_call_t *)compat_14_sys_shmctl },
+#endif
+#ifdef SYSVSEM
+ { SYS_compat_14___semctl, 0, (sy_call_t *)compat_14_sys___semctl },
+#endif
+#ifdef SYSVMSG
+ { SYS_compat_14_msgctl, 0, (sy_call_t *)compat_14_sys_msgctl },
+#endif
+#endif /* defined(COMPAT_14) */
+
+#if defined(COMPAT_50)
+#ifdef SYSVSHM
+ { SYS_compat_50___shmctl13, 0, (sy_call_t *)compat_50_sys___shmctl13 },
+#endif
+#ifdef SYSVSEM
+ { SYS_compat_50_____semctl13, 0, (sy_call_t *)compat_50_sys_____semctl13 },
+#endif
+#ifdef SYSVMSG
+ { SYS_compat_50___msgctl13, 0, (sy_call_t *)compat_50_sys___msgctl13 },
+#endif
+#endif /* defined(COMPAT_50) */
+
+ { 0, 0, NULL }
+};
+
+static int
+compat_sysv_modcmd(modcmd_t cmd, void *arg)
+{
+ static int (*orig_sysvipc50_sysctl)(SYSCTLFN_PROTO);
+
+ int error = 0;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ error = syscall_establish(NULL, compat_syscalls);
+ if (error != 0) {
+ break;
+ }
+#if defined(COMPAT_50)
+ orig_sysvipc50_sysctl = vec_sysvipc50_sysctl;
+ vec_sysvipc50_sysctl = sysctl_kern_sysvipc50;
+#endif
+ break;
+
+ case MODULE_CMD_FINI:
+#if defined(COMPAT_50)
+ vec_sysvipc50_sysctl = orig_sysvipc50_sysctl;
+#endif
+ error = syscall_disestablish(NULL, compat_syscalls);
+ if (error != 0) {
+ break;
+ }
+ break;
+
+ default:
+ error = ENOTTY;
+ break;
+ }
+ return error;
+}
diff -r 1e4b157b1230 -r dda6c4dfcb64 sys/compat/common/compat_sysv_mod.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/common/compat_sysv_mod.h Tue Apr 17 21:59:27 2018 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: compat_sysv_mod.h,v 1.1.2.1 2018/04/17 21:59:27 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.
+ */
+
+#ifndef _COMPAT_COMMON_SYSV_IPC_MOD_H_
+#define _COMPAT_COMMON_SYSV_IPC_MOD_H_
+
+#include <sys/sysctl.h>
+
+extern int (*vec_sysvipc50_sysctl)(SYSCTLFN_PROTO);
+
+int sysctl_kern_sysvipc50(SYSCTLFN_PROTO);
+
+#endif /* _COMPAT_COMMON_SYSV_IPC_MOD_H_ */
diff -r 1e4b157b1230 -r dda6c4dfcb64 sys/compat/common/files.common
--- a/sys/compat/common/files.common Tue Apr 17 08:07:13 2018 +0000
+++ b/sys/compat/common/files.common Tue Apr 17 21:59:27 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.common,v 1.1.2.32 2018/04/17 07:24:55 pgoyette Exp $
+# $NetBSD: files.common,v 1.1.2.33 2018/04/17 21:59:27 pgoyette Exp $
#
# Generic files, used by all compat options.
@@ -109,7 +109,7 @@
# Module interface for sysv ipc compatability options
define compat_sysv : sysvmsg, sysvshm, sysvsem
-file compat/common/sysv_mod.c compat_sysv
+file compat/common/compat_sysv_mod.c compat_sysv
# Compatibility code for NetBSD 1.0
file compat/common/kern_ipc_10.c compat_sysv
diff -r 1e4b157b1230 -r dda6c4dfcb64 sys/compat/common/sysv_mod.c
--- a/sys/compat/common/sysv_mod.c Tue Apr 17 08:07:13 2018 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/* $NetBSD: sysv_mod.c,v 1.1.2.7 2018/03/10 02:20:13 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.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysv_mod.c,v 1.1.2.7 2018/03/10 02:20:13 pgoyette Exp $");
-
-#ifdef _KERNEL_OPT
-#include "opt_compat_netbsd.h"
-#include "opt_sysv.h"
-#endif
-
-#include <sys/systm.h>
-#include <sys/module.h>
-#include <sys/syscall.h>
-#include <sys/syscallargs.h>
-#include <sys/syscallvar.h>
-#include <sys/sysctl.h>
-
-#include <compat/common/sysv_mod.h>
-
-MODULE(MODULE_CLASS_EXEC, compat_sysv, "sysv_ipc");
-
-/* Build the syscall package based on options specified */
-
-static const struct syscall_package compat_syscalls[] = {
-#if defined(COMPAT_10) && !defined(_LP64)
-#ifdef SYSVSHM
- { SYS_compat_10_oshmsys, 0, (sy_call_t *)compat_10_sys_shmsys },
-#endif
-#ifdef SYSVSEM
- { SYS_compat_10_osemsys, 0, (sy_call_t *)compat_10_sys_semsys },
-#endif
-#ifdef SYSVMSG
- { SYS_compat_10_omsgsys, 0, (sy_call_t *)compat_10_sys_msgsys },
-#endif
-#endif /* defined(COMPAT_10) && !defined(_LP64) */
-
-#if defined(COMPAT_14)
-#ifdef SYSVSHM
- { SYS_compat_14_shmctl, 0, (sy_call_t *)compat_14_sys_shmctl },
-#endif
-#ifdef SYSVSEM
- { SYS_compat_14___semctl, 0, (sy_call_t *)compat_14_sys___semctl },
-#endif
-#ifdef SYSVMSG
- { SYS_compat_14_msgctl, 0, (sy_call_t *)compat_14_sys_msgctl },
-#endif
-#endif /* defined(COMPAT_14) */
-
-#if defined(COMPAT_50)
-#ifdef SYSVSHM
- { SYS_compat_50___shmctl13, 0, (sy_call_t *)compat_50_sys___shmctl13 },
-#endif
-#ifdef SYSVSEM
- { SYS_compat_50_____semctl13, 0, (sy_call_t *)compat_50_sys_____semctl13 },
-#endif
-#ifdef SYSVMSG
- { SYS_compat_50___msgctl13, 0, (sy_call_t *)compat_50_sys___msgctl13 },
-#endif
-#endif /* defined(COMPAT_50) */
-
- { 0, 0, NULL }
-};
-
-static int
-compat_sysv_modcmd(modcmd_t cmd, void *arg)
-{
- static int (*orig_sysvipc50_sysctl)(SYSCTLFN_PROTO);
-
- int error = 0;
-
- switch (cmd) {
- case MODULE_CMD_INIT:
- error = syscall_establish(NULL, compat_syscalls);
Home |
Main Index |
Thread Index |
Old Index