summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-03-19 11:01:51 +0000
committerkib <kib@FreeBSD.org>2010-03-19 11:01:51 +0000
commit610214ed4c4cf8e4c9ec77a65d3b4fee64af5657 (patch)
tree6590a090a2882eca5cc58cf69f6653072ac30688 /sys
parentd19a162142eef526ef1ad29b8939ef0b7a92d04c (diff)
downloadFreeBSD-src-610214ed4c4cf8e4c9ec77a65d3b4fee64af5657.zip
FreeBSD-src-610214ed4c4cf8e4c9ec77a65d3b4fee64af5657.tar.gz
Move SysV IPC freebsd32 compat shims helpers from freebsd32_misc.c to
sysv_ipc.c. Reviewed by: jhb MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/freebsd32/freebsd32_ipc.h8
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c54
-rw-r--r--sys/kern/sysv_ipc.c66
3 files changed, 74 insertions, 54 deletions
diff --git a/sys/compat/freebsd32/freebsd32_ipc.h b/sys/compat/freebsd32/freebsd32_ipc.h
index 2b07494..320a63f 100644
--- a/sys/compat/freebsd32/freebsd32_ipc.h
+++ b/sys/compat/freebsd32/freebsd32_ipc.h
@@ -147,6 +147,14 @@ struct shmid_ds32_old {
int32_t shm_ctime;
uint32_t shm_internal;
};
+
+void freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32,
+ struct ipc_perm *ip);
+void freebsd32_ipcperm_old_out(struct ipc_perm *ip,
+ struct ipc_perm32_old *ip32);
#endif
+void freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip);
+void freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32);
+
#endif /* !_COMPAT_FREEBSD32_FREEBSD32_IPC_H_ */
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 7a7dc2e..424bb94 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -1400,60 +1400,6 @@ freebsd4_freebsd32_fhstatfs(struct thread *td, struct freebsd4_freebsd32_fhstatf
}
#endif
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
- defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-static void
-freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32, struct ipc_perm *ip)
-{
-
- CP(*ip32, *ip, cuid);
- CP(*ip32, *ip, cgid);
- CP(*ip32, *ip, uid);
- CP(*ip32, *ip, gid);
- CP(*ip32, *ip, mode);
- CP(*ip32, *ip, seq);
- CP(*ip32, *ip, key);
-}
-
-static void
-freebsd32_ipcperm_old_out(struct ipc_perm *ip, struct ipc_perm32_old *ip32)
-{
-
- CP(*ip, *ip32, cuid);
- CP(*ip, *ip32, cgid);
- CP(*ip, *ip32, uid);
- CP(*ip, *ip32, gid);
- CP(*ip, *ip32, mode);
- CP(*ip, *ip32, seq);
- CP(*ip, *ip32, key);
-}
-#endif
-
-static void
-freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip)
-{
-
- CP(*ip32, *ip, cuid);
- CP(*ip32, *ip, cgid);
- CP(*ip32, *ip, uid);
- CP(*ip32, *ip, gid);
- CP(*ip32, *ip, mode);
- CP(*ip32, *ip, seq);
- CP(*ip32, *ip, key);
-}
-
-static void
-freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32)
-{
-
- CP(*ip, *ip32, cuid);
- CP(*ip, *ip32, cgid);
- CP(*ip, *ip32, uid);
- CP(*ip, *ip32, gid);
- CP(*ip, *ip32, mode);
- CP(*ip, *ip32, seq);
- CP(*ip, *ip32, key);
-}
int
freebsd32_semsys(struct thread *td, struct freebsd32_semsys_args *uap)
diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c
index d33fdb0..e402cb5 100644
--- a/sys/kern/sysv_ipc.c
+++ b/sys/kern/sysv_ipc.c
@@ -178,3 +178,69 @@ ipcperm_new2old(struct ipc_perm *new, struct ipc_perm_old *old)
old->key = new->key;
}
#endif
+
+#ifdef COMPAT_FREEBSD32
+#include <sys/mount.h>
+#include <sys/socket.h>
+#include <compat/freebsd32/freebsd32.h>
+#include <compat/freebsd32/freebsd32_ipc.h>
+#include <compat/freebsd32/freebsd32_proto.h>
+#include <compat/freebsd32/freebsd32_signal.h>
+#include <compat/freebsd32/freebsd32_syscall.h>
+#include <compat/freebsd32/freebsd32_util.h>
+
+#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
+ defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+void
+freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32, struct ipc_perm *ip)
+{
+
+ CP(*ip32, *ip, cuid);
+ CP(*ip32, *ip, cgid);
+ CP(*ip32, *ip, uid);
+ CP(*ip32, *ip, gid);
+ CP(*ip32, *ip, mode);
+ CP(*ip32, *ip, seq);
+ CP(*ip32, *ip, key);
+}
+
+void
+freebsd32_ipcperm_old_out(struct ipc_perm *ip, struct ipc_perm32_old *ip32)
+{
+
+ CP(*ip, *ip32, cuid);
+ CP(*ip, *ip32, cgid);
+ CP(*ip, *ip32, uid);
+ CP(*ip, *ip32, gid);
+ CP(*ip, *ip32, mode);
+ CP(*ip, *ip32, seq);
+ CP(*ip, *ip32, key);
+}
+#endif
+
+void
+freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip)
+{
+
+ CP(*ip32, *ip, cuid);
+ CP(*ip32, *ip, cgid);
+ CP(*ip32, *ip, uid);
+ CP(*ip32, *ip, gid);
+ CP(*ip32, *ip, mode);
+ CP(*ip32, *ip, seq);
+ CP(*ip32, *ip, key);
+}
+
+void
+freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32)
+{
+
+ CP(*ip, *ip32, cuid);
+ CP(*ip, *ip32, cgid);
+ CP(*ip, *ip32, uid);
+ CP(*ip, *ip32, gid);
+ CP(*ip, *ip32, mode);
+ CP(*ip, *ip32, seq);
+ CP(*ip, *ip32, key);
+}
+#endif
OpenPOWER on IntegriCloud