Commit 53fbd0b0 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: use generic ipc syscall translation

From: David Gibson <david@gibson.dropbear.id.au>

Currently ppc64 has its own code to convert 32-bit ipc() syscalls to 64-bit,
rather than using the common translation code from ipc/compat.c.  This patch,
tweaked slightly from an earlier version of Anton Blanchard's fixes that,
replacing the ppc64 code with calls to the common code.

I've run the LSB IPC tests, and as many of the LTP IPC tests as I could figure
out how to run easily, and it seems to pass them all.
parent bf434bf2
...@@ -49,6 +49,10 @@ config FORCE_MAX_ZONEORDER ...@@ -49,6 +49,10 @@ config FORCE_MAX_ZONEORDER
source "init/Kconfig" source "init/Kconfig"
config SYSVIPC_COMPAT
bool
depends on COMPAT && SYSVIPC
default y
menu "Platform support" menu "Platform support"
......
This diff is collapsed.
...@@ -25,6 +25,7 @@ typedef u16 compat_ipc_pid_t; ...@@ -25,6 +25,7 @@ typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t; typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t; typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t; typedef __kernel_fsid_t compat_fsid_t;
typedef s32 compat_key_t;
typedef s32 compat_int_t; typedef s32 compat_int_t;
typedef s32 compat_long_t; typedef s32 compat_long_t;
...@@ -136,4 +137,66 @@ static inline void *compat_alloc_user_space(long len) ...@@ -136,4 +137,66 @@ static inline void *compat_alloc_user_space(long len)
return (void *) (usp - len); return (void *) (usp - len);
} }
/*
* ipc64_perm is actually 32/64bit clean but since the compat layer refers to
* it we may as well define it.
*/
struct compat_ipc64_perm {
compat_key_t key;
compat_uid_t uid;
compat_gid_t gid;
compat_uid_t cuid;
compat_gid_t cgid;
compat_mode_t mode;
unsigned int seq;
unsigned int __pad2;
unsigned long __unused1; /* yes they really are 64bit pads */
unsigned long __unused2;
};
struct compat_semid64_ds {
struct compat_ipc64_perm sem_perm;
unsigned int __unused1;
compat_time_t sem_otime;
unsigned int __unused2;
compat_time_t sem_ctime;
compat_ulong_t sem_nsems;
compat_ulong_t __unused3;
compat_ulong_t __unused4;
};
struct compat_msqid64_ds {
struct compat_ipc64_perm msg_perm;
unsigned int __unused1;
compat_time_t msg_stime;
unsigned int __unused2;
compat_time_t msg_rtime;
unsigned int __unused3;
compat_time_t msg_ctime;
compat_ulong_t msg_cbytes;
compat_ulong_t msg_qnum;
compat_ulong_t msg_qbytes;
compat_pid_t msg_lspid;
compat_pid_t msg_lrpid;
compat_ulong_t __unused4;
compat_ulong_t __unused5;
};
struct compat_shmid64_ds {
struct compat_ipc64_perm shm_perm;
unsigned int __unused1;
compat_time_t shm_atime;
unsigned int __unused2;
compat_time_t shm_dtime;
unsigned int __unused3;
compat_time_t shm_ctime;
unsigned int __unused4;
compat_size_t shm_segsz;
compat_pid_t shm_cpid;
compat_pid_t shm_lpid;
compat_ulong_t shm_nattch;
compat_ulong_t __unused5;
compat_ulong_t __unused6;
};
#endif /* _ASM_PPC64_COMPAT_H */ #endif /* _ASM_PPC64_COMPAT_H */
...@@ -141,9 +141,4 @@ struct ucontext32 { ...@@ -141,9 +141,4 @@ struct ucontext32 {
struct mcontext32 uc_mcontext; struct mcontext32 uc_mcontext;
}; };
struct ipc_kludge_32 {
unsigned int msgp;
int msgtyp;
};
#endif /* _PPC64_PPC32_H */ #endif /* _PPC64_PPC32_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment