Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Split out the SYSV IPC stuff into its own compat_netbsd32_sy...
details: https://anonhg.NetBSD.org/src/rev/473fbf201ae2
branches: trunk
changeset: 342029:473fbf201ae2
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu Dec 03 10:38:21 2015 +0000
description:
Split out the SYSV IPC stuff into its own compat_netbsd32_sysvipc
module. Adjust dependencies as needed.
diffstat:
distrib/sets/lists/modules/ad.arm | 4 +-
distrib/sets/lists/modules/ad.mips | 4 +-
distrib/sets/lists/modules/md.amd64 | 4 +-
sys/compat/netbsd32/netbsd32_compat_10.c | 13 +-
sys/compat/netbsd32/netbsd32_compat_14.c | 28 +-
sys/compat/netbsd32/netbsd32_compat_50.c | 164 +-------------------
sys/compat/netbsd32/netbsd32_compat_50_sysv.c | 210 ++++++++++++++++++++++++++
sys/compat/netbsd32/netbsd32_ipc.c | 90 ++++++++++-
sys/compat/netbsd32/syscalls.master | 123 +++++---------
sys/modules/Makefile | 4 +-
sys/modules/compat_netbsd32/Makefile | 6 +-
sys/modules/compat_netbsd32_sysvipc/Makefile | 19 ++
12 files changed, 404 insertions(+), 265 deletions(-)
diffs (truncated from 985 to 300 lines):
diff -r 95eeb758ca89 -r 473fbf201ae2 distrib/sets/lists/modules/ad.arm
--- a/distrib/sets/lists/modules/ad.arm Thu Dec 03 04:39:41 2015 +0000
+++ b/distrib/sets/lists/modules/ad.arm Thu Dec 03 10:38:21 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.7 2015/12/01 23:59:16 pgoyette Exp $
+# $NetBSD: ad.arm,v 1.8 2015/12/03 10:38:21 pgoyette Exp $
./@MODULEDIR@/compat_netbsd32 base-kernel-modules kmod
./@MODULEDIR@/compat_netbsd32/compat_netbsd32.kmod base-kernel-modules kmod
@@ -6,5 +6,7 @@
./@MODULEDIR@/compat_netbsd32_mqueue/compat_netbsd32_mqueue.kmod base-kernel-modules kmod
./@MODULEDIR@/compat_netbsd32_nfssrv base-kernel-modules kmod
./@MODULEDIR@/compat_netbsd32_nfssrv/compat_netbsd32_nfssrv.kmod base-kernel-modules kmod
+./@MODULEDIR@/compat_netbsd32_sysvipc base-kernel-modules kmod
+./@MODULEDIR@/compat_netbsd32_sysvipc/compat_netbsd32_sysvipc.kmod base-kernel-modules kmod
./@MODULEDIR@/exec_elf32 base-kernel-modules kmod
./@MODULEDIR@/exec_elf32/exec_elf32.kmod base-kernel-modules kmod
diff -r 95eeb758ca89 -r 473fbf201ae2 distrib/sets/lists/modules/ad.mips
--- a/distrib/sets/lists/modules/ad.mips Thu Dec 03 04:39:41 2015 +0000
+++ b/distrib/sets/lists/modules/ad.mips Thu Dec 03 10:38:21 2015 +0000
@@ -1,9 +1,11 @@
-# $NetBSD: ad.mips,v 1.7 2015/12/01 23:59:16 pgoyette Exp $
+# $NetBSD: ad.mips,v 1.8 2015/12/03 10:38:21 pgoyette Exp $
./@MODULEDIR@/compat_netbsd32 base-kernel-modules kmod,arch64,nocompatmodules
./@MODULEDIR@/compat_netbsd32/compat_netbsd32.kmod base-kernel-modules kmod,arch64,nocompatmodules
./@MODULEDIR@/compat_netbsd32_mqueue base-kernel-modules kmod,arch64,nocompatmodules
./@MODULEDIR@/compat_netbsd32_mqueue/compat_netbsd32_mqueue.kmod base-kernel-modules kmod,arch64,nocompatmodules
./@MODULEDIR@/compat_netbsd32_nfssrv base-kernel-modules kmod,arch64,nocompatmodules
./@MODULEDIR@/compat_netbsd32_nfssrv/compat_netbsd32_nfssrv.kmod base-kernel-modules kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_sysvipc base-kernel-modules kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_sysvipc/compat_netbsd32_sysvipc.kmod base-kernel-modules kmod,arch64,nocompatmodules
./@MODULEDIR@/exec_elf32 base-kernel-modules kmod
./@MODULEDIR@/exec_elf32/exec_elf32.kmod base-kernel-modules kmod
diff -r 95eeb758ca89 -r 473fbf201ae2 distrib/sets/lists/modules/md.amd64
--- a/distrib/sets/lists/modules/md.amd64 Thu Dec 03 04:39:41 2015 +0000
+++ b/distrib/sets/lists/modules/md.amd64 Thu Dec 03 10:38:21 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.65 2015/12/01 23:59:16 pgoyette Exp $
+# $NetBSD: md.amd64,v 1.66 2015/12/03 10:38:21 pgoyette Exp $
#
# NOTE that there are two sets of files here:
# @MODULEDIR@ and amd64-xen
@@ -55,6 +55,8 @@
./@MODULEDIR@/compat_netbsd32_mqueue/compat_netbsd32_mqueue.kmod base-kernel-modules kmod
./@MODULEDIR@/compat_netbsd32_nfssrv base-kernel-modules kmod
./@MODULEDIR@/compat_netbsd32_nfssrv/compat_netbsd32_nfssrv.kmod base-kernel-modules kmod
+./@MODULEDIR@/compat_netbsd32_sysvipc base-kernel-modules kmod
+./@MODULEDIR@/compat_netbsd32_sysvipc/compat_netbsd32_sysvipc.kmod base-kernel-modules kmod
./@MODULEDIR@/coram base-kernel-modules kmod
./@MODULEDIR@/coram/coram.kmod base-kernel-modules kmod
./@MODULEDIR@/coretemp base-kernel-modules kmod
diff -r 95eeb758ca89 -r 473fbf201ae2 sys/compat/netbsd32/netbsd32_compat_10.c
--- a/sys/compat/netbsd32/netbsd32_compat_10.c Thu Dec 03 04:39:41 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_10.c Thu Dec 03 10:38:21 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_10.c,v 1.24 2010/04/23 15:19:20 rmind Exp $ */
+/* $NetBSD: netbsd32_compat_10.c,v 1.25 2015/12/03 10:38:21 pgoyette Exp $ */
/*
* Copyright (c) 1994 Adam Glass and Charles M. Hannum. All rights reserved.
@@ -31,10 +31,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_10.c,v 1.24 2010/04/23 15:19:20 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_10.c,v 1.25 2015/12/03 10:38:21 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_sysv.h"
+#include "opt_compat_netbsd.h"
#endif
#include <sys/param.h>
@@ -50,7 +51,8 @@
#include <compat/netbsd32/netbsd32_syscallargs.h>
#include <compat/sys/shm.h>
-#if defined(SYSVSEM) || !defined(_KERNEL_OPT)
+#if defined(COMPAT_10)
+#if defined(SYSVSEM)
int
compat_10_netbsd32_semsys(struct lwp *l, const struct compat_10_netbsd32_semsys_args *uap, register_t *retval)
{
@@ -112,7 +114,7 @@
}
#endif
-#if defined(SYSVSHM) || !defined(_KERNEL_OPT)
+#if defined(SYSVSHM)
int
compat_10_netbsd32_shmsys(struct lwp *l, const struct compat_10_netbsd32_shmsys_args *uap, register_t *retval)
{
@@ -170,7 +172,7 @@
}
#endif
-#if defined(SYSVMSG) || !defined(_KERNEL)
+#if defined(SYSVMSG)
int
compat_10_netbsd32_msgsys(struct lwp *l, const struct compat_10_netbsd32_msgsys_args *uap, register_t *retval)
{
@@ -237,3 +239,4 @@
}
}
#endif
+#endif /* COMPAT_10 */
diff -r 95eeb758ca89 -r 473fbf201ae2 sys/compat/netbsd32/netbsd32_compat_14.c
--- a/sys/compat/netbsd32/netbsd32_compat_14.c Thu Dec 03 04:39:41 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_14.c Thu Dec 03 10:38:21 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_14.c,v 1.21 2007/12/20 23:03:01 dsl Exp $ */
+/* $NetBSD: netbsd32_compat_14.c,v 1.22 2015/12/03 10:38:21 pgoyette Exp $ */
/*
* Copyright (c) 1999 Eduardo E. Horvath
@@ -29,7 +29,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_14.c,v 1.21 2007/12/20 23:03:01 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_14.c,v 1.22 2015/12/03 10:38:21 pgoyette Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_sysv.h"
+#include "opt_compat_netbsd.h"
+#endif
#include <sys/param.h>
#include <sys/ipc.h>
@@ -41,21 +46,13 @@
#include <sys/sem.h>
#include <sys/shm.h>
-#ifndef SYSVMSG
-#define SYSVMSG
-#endif
-#ifndef SYSVSEM
-#define SYSVSEM
-#endif
-#ifndef SYSVSHM
-#define SYSVSHM
-#endif
-
#include <sys/syscallargs.h>
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
#include <compat/sys/shm.h>
+#if defined(COMPAT_14)
+
static inline void
netbsd32_ipc_perm14_to_native(struct netbsd32_ipc_perm14 *, struct ipc_perm *);
static inline void
@@ -207,6 +204,7 @@
/*
* the compat_14 system calls
*/
+#if defined(SYSVMSG)
int
compat_14_netbsd32_msgctl(struct lwp *l, const struct compat_14_netbsd32_msgctl_args *uap, register_t *retval)
{
@@ -240,7 +238,9 @@
return (error);
}
+#endif
+#if defined(SYSVSEM)
int
compat_14_netbsd32___semctl(struct lwp *l, const struct compat_14_netbsd32___semctl_args *uap, register_t *retval)
{
@@ -294,7 +294,9 @@
return (error);
}
+#endif
+#if defined(SYSVSHM)
int
compat_14_netbsd32_shmctl(struct lwp *l, const struct compat_14_netbsd32_shmctl_args *uap, register_t *retval)
{
@@ -326,3 +328,5 @@
return (error);
}
+#endif
+#endif /* COMPAT_14 */
diff -r 95eeb758ca89 -r 473fbf201ae2 sys/compat/netbsd32/netbsd32_compat_50.c
--- a/sys/compat/netbsd32/netbsd32_compat_50.c Thu Dec 03 04:39:41 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_50.c Thu Dec 03 10:38:21 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_50.c,v 1.31 2015/12/01 23:56:43 pgoyette Exp $ */
+/* $NetBSD: netbsd32_compat_50.c,v 1.32 2015/12/03 10:38:21 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,10 +36,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.31 2015/12/01 23:56:43 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.32 2015/12/03 10:38:21 pgoyette Exp $");
#if defined(_KERNEL_OPT)
-#include "opt_sysv.h"
+#include "opt_compat_netbsd.h"
#endif
#include <sys/param.h>
@@ -63,10 +63,6 @@
#include <sys/dirent.h>
#include <sys/kauth.h>
#include <sys/vfs_syscalls.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include <sys/sem.h>
-#include <sys/shm.h>
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
@@ -74,6 +70,7 @@
#include <compat/sys/mount.h>
#include <compat/sys/time.h>
+#if defined(COMPAT_50)
/*
* Common routine to set access and modification times given a vnode.
@@ -909,158 +906,6 @@
return copyout(&s32it, SCARG_P32(uap, itv), sizeof(s32it));
}
-#if defined(SYSVSEM)
-
-int
-compat_50_netbsd32___semctl14(struct lwp *l, const struct compat_50_netbsd32___semctl14_args *uap, register_t *retval)
-{
- return do_netbsd32___semctl14(l, uap, retval, NULL);
-}
-
-int
-do_netbsd32___semctl14(struct lwp *l, const struct compat_50_netbsd32___semctl14_args *uap, register_t *retval, void *vkarg)
-{
- /* {
- syscallarg(int) semid;
- syscallarg(int) semnum;
- syscallarg(int) cmd;
- syscallarg(netbsd32_semun50p_t) arg;
- } */
- struct semid_ds sembuf;
- struct netbsd32_semid_ds50 sembuf32;
- int cmd, error;
- void *pass_arg;
- union __semun karg;
- union netbsd32_semun50 karg32;
-
- cmd = SCARG(uap, cmd);
-
- switch (cmd) {
- case IPC_SET:
- case IPC_STAT:
- pass_arg = &sembuf;
- break;
-
- case GETALL:
- case SETVAL:
- case SETALL:
- pass_arg = &karg;
- break;
- default:
- pass_arg = NULL;
- break;
- }
-
- if (pass_arg) {
- if (vkarg != NULL)
- karg32 = *(union netbsd32_semun50 *)vkarg;
- else {
- error = copyin(SCARG_P32(uap, arg), &karg32,
- sizeof(karg32));
- if (error)
- return error;
- }
- if (pass_arg == &karg) {
- switch (cmd) {
- case GETALL:
- case SETALL:
- karg.array = NETBSD32PTR64(karg32.array);
- break;
- case SETVAL:
- karg.val = karg32.val;
- break;
- }
- }
- if (cmd == IPC_SET) {
- error = copyin(NETBSD32PTR64(karg32.buf), &sembuf32,
- sizeof(sembuf32));
- if (error)
- return (error);
- netbsd32_to_semid_ds50(&sembuf32, &sembuf);
Home |
Main Index |
Thread Index |
Old Index