Skip to contentSkip to conversation

generic 32 bit emulation for System-V IPC

PATCH In review [email protected] 4 participants 4 messages Mar 15, 2004 – Mar 16, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic 32 bit emulation for System-V IPC

From: Arnd Bergmann <[email protected]>

Adds a generic implementation of 32 bit emulation for IPC system calls. The code is based on the existing implementations for sparc64, ia64, mips, s390, ppc and x86_64, which can subsequently be converted to use this.

---

 25-akpm/arch/ia64/Kconfig               |    6 
 25-akpm/arch/ia64/ia32/sys_ia32.c       |  605 --------------------------
 25-akpm/arch/s390/Kconfig               |    5 
 25-akpm/arch/s390/kernel/compat_linux.c |  609 +-------------------------
 25-akpm/arch/x86_64/Kconfig             |    4 
 25-akpm/arch/x86_64/ia32/ipc32.c        |  675 -----------------------------
 25-akpm/include/asm-ia64/compat.h       |   59 ++
 25-akpm/include/asm-s390/compat.h       |   60 ++
 25-akpm/include/asm-x86_64/compat.h     |   59 ++
 25-akpm/include/linux/compat.h          |   12 
 25-akpm/ipc/Makefile                    |    1 
 25-akpm/ipc/compat.c                    |  734 ++++++++++++++++++++++++++++++++
 include/linux/msg.h                     |    0 
 13 files changed, 995 insertions(+), 1834 deletions(-)
include/linux/compat.h renamed from include/linux/compat.h~compat-generic-ipc-emulation +12 -0
diff -puN include/linux/compat.h~compat-generic-ipc-emulation include/linux/compat.h
@@ -10,6 +10,8 @@
 
 #include <linux/stat.h>
 #include <linux/param.h>	/* for HZ */
+#include <linux/sem.h>
+
 #include <asm/compat.h>
 
 #define compat_jiffies_to_clock_t(x)	\
@@ -88,5 +90,15 @@ typedef union compat_sigval {
 	compat_uptr_t	sival_ptr;
 } compat_sigval_t;
 
+long compat_sys_semctl(int first, int second, int third, void __user *uptr);
+long compat_sys_msgsnd(int first, int second, int third, void __user *uptr);
+long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
+		int version, void __user *uptr);
+long compat_sys_msgctl(int first, int second, void __user *uptr);
+long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
+		void __user *uptr);
+long compat_sys_shmctl(int first, int second, void __user *uptr);
+long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
+		unsigned nsems, const struct compat_timespec __user *timeout);
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
ipc/compat.c new file +734 -0

734 lines not on this page · raw message

ipc/Makefile renamed from ipc/Makefile~compat-generic-ipc-emulation +1 -0
diff -puN ipc/Makefile~compat-generic-ipc-emulation ipc/Makefile
@@ -4,4 +4,5 @@
 
 obj-y   := util.o
 
+obj-$(CONFIG_SYSVIPC_COMPAT) += compat.o
 obj-$(CONFIG_SYSVIPC) += msg.o sem.o shm.o
arch/s390/Kconfig renamed from arch/s390/Kconfig~compat-generic-ipc-emulation +5 -0
diff -puN arch/s390/Kconfig~compat-generic-ipc-emulation arch/s390/Kconfig
@@ -143,6 +143,11 @@ config COMPAT
 	depends on S390_SUPPORT
 	default y
 
+config SYSVIPC_COMPAT
+	bool
+	depends on COMPAT && SYSVIPC
+	default y
+
 config BINFMT_ELF32
 	tristate "Kernel support for 31 bit ELF binaries"
 	depends on S390_SUPPORT
arch/s390/kernel/compat_linux.c renamed from arch/s390/kernel/compat_linux.c~compat-generic-ipc-emulation +27 -582

652 lines not on this page · raw message

include/asm-s390/compat.h renamed from include/asm-s390/compat.h~compat-generic-ipc-emulation +60 -0

76 lines not on this page · raw message

arch/x86_64/ia32/ipc32.c renamed from arch/x86_64/ia32/ipc32.c~compat-generic-ipc-emulation +19 -656

710 lines not on this page · raw message

arch/x86_64/Kconfig renamed from arch/x86_64/Kconfig~compat-generic-ipc-emulation +4 -0
diff -puN arch/x86_64/Kconfig~compat-generic-ipc-emulation arch/x86_64/Kconfig
@@ -387,6 +387,10 @@ config COMPAT
 	depends on IA32_EMULATION
 	default y
 
+config SYSVIPC_COMPAT
+	bool
+	depends on COMPAT && SYSVIPC
+	default y
 
 config UID16
 	bool
include/asm-x86_64/compat.h renamed from include/asm-x86_64/compat.h~compat-generic-ipc-emulation +59 -0

71 lines not on this page · raw message

arch/ia64/ia32/sys_ia32.c renamed from arch/ia64/ia32/sys_ia32.c~compat-generic-ipc-emulation +10 -595

643 lines not on this page · raw message

arch/ia64/Kconfig renamed from arch/ia64/Kconfig~compat-generic-ipc-emulation +5 -1
diff -puN arch/ia64/Kconfig~compat-generic-ipc-emulation arch/ia64/Kconfig
@@ -537,7 +537,11 @@ config DEBUG_INFO
 	  debugging info resulting in a larger kernel image.
 	  Say Y here only if you plan to use gdb to debug the kernel.
 	  If you don't debug the kernel, you can say N.
-	  
+
+config SYSVIPC_COMPAT
+	bool
+	depends on COMPAT && SYSVIPC
+	default y
 endmenu
 
 source "security/Kconfig"
include/asm-ia64/compat.h renamed from include/asm-ia64/compat.h~compat-generic-ipc-emulation +59 -0

53 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

diff -puN include/linux/msg.h~compat-generic-ipc-emulation include/linux/msg.h

_

Part of the diff is not shown here. View the raw message.

#2 lore raw
In reply to [email protected]
Quoted 7 lines · [email protected] wrote:

From: Arnd Bergmann <[email protected]>

Adds a generic implementation of 32 bit emulation for IPC system calls. The code is based on the existing implementations for sparc64, ia64, mips, s390, ppc and x86_64, which can subsequently be converted to use this.

Could we get rid of CONFIG_SYSVIPC_COMPAT and use something like:

ipc/Makefile 2004-03-16 10:53:49.000000000 -0800 renamed from ipc/Makefile- 2004-03-16 10:53:48.000000000 -0800 +4 -1
@@ -4,5 +4,8 @@
 
 obj-y   := util.o
 
-obj-$(CONFIG_SYSVIPC_COMPAT) += compat.o
+ifeq ($(CONFIG_SYSVIPC),y)
+obj-$(CONFIG_COMPAT) += compat.o
+endif
+
 obj-$(CONFIG_SYSVIPC) += msg.o sem.o shm.o

-Arun

#3 lore raw
Quoted 1 line · Arun Sharma

Could we get rid of CONFIG_SYSVIPC_COMPAT and use something like:

No; not all 32-bit emulations need it.

Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain