]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] consolidate SIGEV_PAD_SIZE
authorStephen Rothwell <sfr@canb.auug.org.au>
Sun, 1 May 2005 15:59:08 +0000 (08:59 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 1 May 2005 15:59:08 +0000 (08:59 -0700)
Discussing with Matthew Wilcox some of his outstanding patches lead me to
this patch (among others).

The preamble in struct sigevent can be expressed independently of the
architecture.

Also use __ARCH_SI_PREAMBLE_SIZE on ia64.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-alpha/siginfo.h
include/asm-generic/siginfo.h
include/asm-ia64/siginfo.h
include/asm-mips/siginfo.h
include/asm-s390/siginfo.h
include/asm-sparc64/siginfo.h
include/asm-x86_64/siginfo.h

index 86bcab59c52bf02060d8d0a8b2a20be6685be650..9822362a842461a178dcb51fbaf7f922165442f8 100644 (file)
@@ -4,8 +4,6 @@
 #define __ARCH_SI_PREAMBLE_SIZE                (4 * sizeof(int))
 #define __ARCH_SI_TRAPNO
 
-#define SIGEV_PAD_SIZE                 ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
-
 #include <asm-generic/siginfo.h>
 
 #endif
index 9cac8e8dde519460b7b991008fe16a6d74580243..8786e01e0db8060582590e8a4451f7387afdfd8b 100644 (file)
@@ -236,11 +236,18 @@ typedef struct siginfo {
 #define SIGEV_THREAD   2       /* deliver via thread creation */
 #define SIGEV_THREAD_ID 4      /* deliver to thread */
 
-#define SIGEV_MAX_SIZE 64
-#ifndef SIGEV_PAD_SIZE
-#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+/*
+ * This works because the alignment is ok on all current architectures
+ * but we leave open this being overridden in the future
+ */
+#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
+#define __ARCH_SIGEV_PREAMBLE_SIZE     (sizeof(int) * 2 + sizeof(sigval_t))
 #endif
 
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
+               / sizeof(int))
+
 typedef struct sigevent {
        sigval_t sigev_value;
        int sigev_signo;
index d55f139cbcdce37c9db418881029555287758f9b..9294e4b0c8bc395fb17b525c132ebd593053ef70 100644 (file)
@@ -8,9 +8,7 @@
  *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
-#define SI_PAD_SIZE    ((SI_MAX_SIZE/sizeof(int)) - 4)
-
-#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
+#define __ARCH_SI_PREAMBLE_SIZE        (4 * sizeof(int))
 
 #define HAVE_ARCH_SIGINFO_T
 #define HAVE_ARCH_COPY_SIGINFO
index 8ddd3c99bcf786def122495b35fbc1d65f218b31..a0e26e6c994dbd4ec260cbd7007507beb8b062f4 100644 (file)
@@ -11,8 +11,6 @@
 
 #include <linux/config.h>
 
-#define SIGEV_HEAD_SIZE        (sizeof(long) + 2*sizeof(int))
-#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE-SIGEV_HEAD_SIZE) / sizeof(int))
 #undef __ARCH_SI_TRAPNO        /* exception code needs to fill this ...  */
 
 #define HAVE_ARCH_SIGINFO_T
index 72303537b732f6956d340d724283c2357538a226..e0ff1ab054beaf3ac61212a576818446855e9d83 100644 (file)
 #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
 #endif
 
-#ifdef CONFIG_ARCH_S390X
-#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
-#else
-#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
-#endif
-
 #include <asm-generic/siginfo.h>
 
 #endif
index 7160449e7cab1d61e8a6ab61744711229be12bcd..df17e47abc1c49f918aa9bd3bf809292d5e8c728 100644 (file)
@@ -3,8 +3,6 @@
 
 #define SI_PAD_SIZE32  ((SI_MAX_SIZE/sizeof(int)) - 3)
 
-#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
-
 #define __ARCH_SI_PREAMBLE_SIZE        (4 * sizeof(int))
 #define __ARCH_SI_TRAPNO
 #define __ARCH_SI_BAND_T int
index 7bc15985f124e55f36e8e46c2715734146e7a6ad..d09a1e6e72462842c47dd69c6a5eb9c85fcd4820 100644 (file)
@@ -3,8 +3,6 @@
 
 #define __ARCH_SI_PREAMBLE_SIZE        (4 * sizeof(int))
 
-#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
-
 #include <asm-generic/siginfo.h>
 
 #endif