Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys Complete removal of the "monolithic" all-versi...
details: https://anonhg.NetBSD.org/src/rev/ae417a8e1522
branches: pgoyette-compat
changeset: 830681:ae417a8e1522
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Wed Sep 12 21:46:08 2018 +0000
description:
Complete removal of the "monolithic" all-version compat_sysvipc module
diffstat:
sys/compat/common/compat_sysv_mod.c | 127 ------------------------------------
sys/compat/common/files.common | 29 ++++---
sys/modules/Makefile | 4 +-
sys/modules/compat_sysv/Makefile | 23 ------
4 files changed, 18 insertions(+), 165 deletions(-)
diffs (228 lines):
diff -r 892ff8a2e6bb -r ae417a8e1522 sys/compat/common/compat_sysv_mod.c
--- a/sys/compat/common/compat_sysv_mod.c Wed Sep 12 08:09:23 2018 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/* $NetBSD: compat_sysv_mod.c,v 1.4.10.4 2018/09/07 23:32:30 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.4 2018/09/07 23:32:30 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_sysv_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_sysv_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_sysv_syscalls);
- if (error != 0) {
- break;
- }
- break;
-
- default:
- error = ENOTTY;
- break;
- }
- return error;
-}
diff -r 892ff8a2e6bb -r ae417a8e1522 sys/compat/common/files.common
--- a/sys/compat/common/files.common Wed Sep 12 08:09:23 2018 +0000
+++ b/sys/compat/common/files.common Wed Sep 12 21:46:08 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.common,v 1.1.2.34 2018/09/10 08:41:47 pgoyette Exp $
+# $NetBSD: files.common,v 1.1.2.35 2018/09/12 21:46:09 pgoyette Exp $
#
# Generic files, used by all compat options.
@@ -108,20 +108,25 @@
# Module interface for sysv ipc compatability options
-define compat_sysv : sysvmsg, sysvshm, sysvsem
-file compat/common/compat_sysv_mod.c compat_sysv
-
# Compatibility code for NetBSD 1.0
-file compat/common/kern_ipc_10.c compat_sysv
+file compat/common/compat_sysv_10_mod.c compat_10 &
+ (sysvmsg | sysvshm | sysvsem)
+file compat/common/kern_ipc_10.c compat_10 &
+ (sysvmsg | sysvshm | sysvsem)
# Compatibility code for NetBSD 1.4
-file compat/common/sysv_msg_14.c compat_sysv
-file compat/common/sysv_sem_14.c compat_sysv
-file compat/common/sysv_shm_14.c compat_sysv
+file compat/common/compat_sysv_14_mod.c compat_14 &
+ (sysvmsg | sysvshm | sysvsem)
+file compat/common/sysv_msg_14.c compat_14 & sysvmsg
+file compat/common/sysv_sem_14.c compat_14 & sysvsem
+file compat/common/sysv_shm_14.c compat_14 & sysvshm
# Compatibility code for NetBSD 5.0
-file compat/common/sysv_ipc_50.c compat_sysv
-file compat/common/sysv_msg_50.c compat_sysv
-file compat/common/sysv_sem_50.c compat_sysv
-file compat/common/sysv_shm_50.c compat_sysv
+file compat/common/compat_sysv_50_mod.c compat_50 &
+ (sysvmsg | sysvshm | sysvsem)
+file compat/common/sysv_ipc_50.c compat_50 &
+ (sysvmsg | sysvshm | sysvsem)
+file compat/common/sysv_msg_50.c compat_50 & sysvmsg
+file compat/common/sysv_sem_50.c compat_50 & sysvsem
+file compat/common/sysv_shm_50.c compat_50 & sysvshm
diff -r 892ff8a2e6bb -r ae417a8e1522 sys/modules/Makefile
--- a/sys/modules/Makefile Wed Sep 12 08:09:23 2018 +0000
+++ b/sys/modules/Makefile Wed Sep 12 21:46:08 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.202.2.32 2018/09/12 04:35:22 pgoyette Exp $
+# $NetBSD: Makefile,v 1.202.2.33 2018/09/12 21:46:08 pgoyette Exp $
.include <bsd.own.mk>
@@ -6,14 +6,12 @@
# Modules for compatability with earlier versions of NetBSD
-#SUBDIR+= compat
SUBDIR+= compat_util
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
-#SUBDIR+= compat_sysv
SUBDIR+= compat_sysv_10 compat_sysv_14 compat_sysv_50
SUBDIR+= accf_dataready
diff -r 892ff8a2e6bb -r ae417a8e1522 sys/modules/compat_sysv/Makefile
--- a/sys/modules/compat_sysv/Makefile Wed Sep 12 08:09:23 2018 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-# $NetBSD: Makefile,v 1.3.10.5 2018/04/17 23:06:11 pgoyette Exp $
-
-.include "../Makefile.inc"
-
-.PATH: ${S}/kern
-
-KMOD= compat_sysv
-
-CPPFLAGS+= -DSYSVSEM -DSYSVSHM -DSYSVMSG
-
-.PATH: ${S}/compat/common
-
-CPPFLAGS+= -DCOMPAT_10
-CPPFLAGS+= -DCOMPAT_13
-CPPFLAGS+= -DCOMPAT_14
-CPPFLAGS+= -DCOMPAT_50
-
-SRCS+= compat_sysv_mod.c
-SRCS+= kern_ipc_10.c sysv_ipc_50.c
-SRCS+= sysv_msg_14.c sysv_sem_14.c sysv_shm_14.c
-SRCS+= sysv_msg_50.c sysv_sem_50.c sysv_shm_50.c
-
-.include <bsd.kmodule.mk>
Home |
Main Index |
Thread Index |
Old Index