Skip to contentSkip to conversation

PATCH [email protected] 1 participant 1 message Apr 27, 2009

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw
Quoted 1 line

From [email protected] Mon Apr 27 16:28:40 2009

References: <[email protected]>
User-Agent: quilt/0.46-1
Date: Mon, 27 Apr 2009 16:20:18 +0200
From: [email protected]
To: [email protected]
Cc: [email protected],
[email protected], [email protected], [email protected], [email protected],
Sam Ravnborg <[email protected]>,
Remis Lima Baima <remis.developer-gM/[email protected]>
Subject: [RFC 08/17] asm-generic: provide generic sysv ipc headers
Content-Disposition: inline; filename=0004-asm-generic-provide-generic-sysv-ipc-headers.patch
X-Provags-ID: V01U2FsdGVkX1+Kl7DmXJTbtEAT0uuCsHRVKXdMrzvwlp5SVB1
HvmO/3P/3uaWUtFuWtB7Nr//7R5Fpt2irDSbCcvoDNO8/QZbcz
6kBqKp8zAhX/4qGIsHSzA==

The ipc64 data structures were originally meant to be architecture specific so that each architecture could add their own optimizations for padding.

In the end, most of them just copied the x86 version, and most got that wrong. UClibc expects the x86 anyway, so we might just declare that the default and get rid of the extra copies.

---

 include/asm-generic/Kbuild     |    5 	5 +	0 -	0 !
 include/asm-generic/ipcbuf.h   |   33 	33 +	0 -	0 !
 include/asm-generic/msgbuf.h   |   47 	47 +	0 -	0 !
 include/asm-generic/sembuf.h   |   38 	38 +	0 -	0 !
 include/asm-generic/shmbuf.h   |   59 	59 +	0 -	0 !
 include/asm-generic/shmparam.h |    6 	6 +	0 -	0 !
 6 files changed, 188 insertions(+)
 create mode 100644 include/asm-generic/ipcbuf.h
 create mode 100644 include/asm-generic/msgbuf.h
 create mode 100644 include/asm-generic/sembuf.h
 create mode 100644 include/asm-generic/shmbuf.h
 create mode 100644 include/asm-generic/shmparam.h
include/asm-generic/Kbuild +5 -0
Index: linux-2.6/include/asm-generic/Kbuild
===================================================================
@@ -2,9 +2,14 @@ header-y += errno-base.h
 header-y += errno.h
 header-y += fcntl.h
 header-y += ioctl.h
+header-y += ipcbuf.h
 header-y += mman-common.h
 header-y += mman.h
+header-y += msgbuf.h
 header-y += poll.h
+header-y += sembuf.h
+header-y += shmbuf.h
+header-y += shmparam.h
 header-y += signal-defs.h
 header-y += signal.h
 header-y += statfs.h
include/asm-generic/ipcbuf.h new file +33 -0
Index: linux-2.6/include/asm-generic/ipcbuf.h
===================================================================
@@ -0,0 +1,33 @@
+#ifndef __ASM_GENERIC_IPCBUF_H
+#define __ASM_GENERIC_IPCBUF_H
+
+/*
+ * The generic ipc64_perm structure:
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * ipc64_perm was originally meant to be architecture specific, but
+ * everyone just ended up making identical copies without specific
+ * optimizations, so we may just as well all use the same one.
+ *
+ * Pad space is left for:
+ * - 32-bit mode_t on architectures that only had 16 bit
+ * - 32-bit seq
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct ipc64_perm {
+	__kernel_key_t		key;
+	__kernel_uid32_t	uid;
+	__kernel_gid32_t	gid;
+	__kernel_uid32_t	cuid;
+	__kernel_gid32_t	cgid;
+	__kernel_mode_t		mode;
+	unsigned short		__pad1;
+	unsigned short		seq;
+	unsigned short		__pad2;
+	unsigned long		__unused1;
+	unsigned long		__unused2;
+};
+
+#endif /* __ASM_GENERIC_IPCBUF_H */
include/asm-generic/msgbuf.h new file +47 -0

47 lines not on this page · raw message

include/asm-generic/sembuf.h new file +38 -0
Index: linux-2.6/include/asm-generic/sembuf.h
===================================================================
@@ -0,0 +1,38 @@
+#ifndef __ASM_GENERIC_SEMBUF_H
+#define __ASM_GENERIC_SEMBUF_H
+
+#include <asm/bitsperlong.h>
+
+/*
+ * The semid64_ds structure for x86 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * semid64_ds was originally meant to be architecture specific, but
+ * everyone just ended up making identical copies without specific
+ * optimizations, so we may just as well all use the same one.
+ *
+ * 64 bit architectures typically define a 64 bit __kernel_time_t,
+ * so they do not need the first two padding words.
+ * On big-endian systems, the padding is in the wrong place.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+struct semid64_ds {
+	struct ipc64_perm sem_perm;	/* permissions .. see ipc.h */
+	__kernel_time_t	sem_otime;	/* last semop time */
+#if __BITS_PER_LONG != 64
+	unsigned long	__unused1;
+#endif
+	__kernel_time_t	sem_ctime;	/* last change time */
+#if __BITS_PER_LONG != 64
+	unsigned long	__unused2;
+#endif
+	unsigned long	sem_nsems;	/* no. of semaphores in array */
+	unsigned long	__unused3;
+	unsigned long	__unused4;
+};
+
+#endif /* __ASM_GENERIC_SEMBUF_H */
include/asm-generic/shmbuf.h new file +59 -0

59 lines not on this page · raw message

include/asm-generic/shmparam.h new file +6 -0
Index: linux-2.6/include/asm-generic/shmparam.h
===================================================================
@@ -0,0 +1,6 @@
+#ifndef __ASM_GENERIC_SHMPARAM_H
+#define __ASM_GENERIC_SHMPARAM_H
+
+#define SHMLBA PAGE_SIZE	 /* attach addr a multiple of this */
+
+#endif /* _ASM_GENERIC_SHMPARAM_H */
Signature · 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html