compat: move compat_siginfo_t definition to asm/compat.h
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 5 Oct 2012 00:15:31 +0000 (17:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Oct 2012 18:05:16 +0000 (03:05 +0900)
This is a preparatory patch for the introduction of NT_SIGINFO elf note.

Make the location of compat_siginfo_t uniform across eight architectures
which have it.  Now it can be pulled in by including asm/compat.h or
linux/compat.h.

Most of the copies are verbatim.  compat_uid[32]_t had to be replaced by
__compat_uid[32]_t.  compat_uptr_t had to be moved up before
compat_siginfo_t in asm/compat.h on a several architectures (tile already
had it moved up).  compat_sigval_t had to be relocated from linux/compat.h
to asm/compat.h.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: "Jonathan M. Foote" <jmfoote@cert.org>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
19 files changed:
arch/arm64/include/asm/compat.h
arch/arm64/kernel/signal32.c
arch/mips/include/asm/compat-signal.h
arch/mips/include/asm/compat.h
arch/parisc/include/asm/compat.h
arch/parisc/kernel/signal32.h
arch/powerpc/include/asm/compat.h
arch/powerpc/include/asm/siginfo.h
arch/powerpc/kernel/ppc32.h
arch/s390/include/asm/compat.h
arch/s390/kernel/compat_linux.h
arch/sparc/include/asm/compat.h
arch/sparc/include/asm/siginfo.h
arch/sparc/kernel/signal32.c
arch/tile/include/asm/compat.h
arch/tile/kernel/compat_signal.c
arch/x86/include/asm/compat.h
arch/x86/include/asm/ia32.h
include/linux/compat.h

index a670a33ad7366b0262a14dc938060e6a9bb66225..37e610dc084ed76b532f0647f07d6c2085b69798 100644 (file)
@@ -55,6 +55,7 @@ typedef s64           compat_s64;
 typedef u32            compat_uint_t;
 typedef u32            compat_ulong_t;
 typedef u64            compat_u64;
+typedef u32            compat_uptr_t;
 
 struct compat_timespec {
        compat_time_t   tv_sec;
@@ -130,6 +131,64 @@ typedef u32                compat_old_sigset_t;
 
 typedef u32            compat_sigset_word;
 
+typedef union compat_sigval {
+       compat_int_t    sival_int;
+       compat_uptr_t   sival_ptr;
+} compat_sigval_t;
+
+typedef struct compat_siginfo {
+       int si_signo;
+       int si_errno;
+       int si_code;
+
+       union {
+               /* The padding is the same size as AArch64. */
+               int _pad[128/sizeof(int) - 3];
+
+               /* kill() */
+               struct {
+                       compat_pid_t _pid;      /* sender's pid */
+                       __compat_uid32_t _uid;  /* sender's uid */
+               } _kill;
+
+               /* POSIX.1b timers */
+               struct {
+                       compat_timer_t _tid;    /* timer id */
+                       int _overrun;           /* overrun count */
+                       compat_sigval_t _sigval;        /* same as below */
+                       int _sys_private;       /* not to be passed to user */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       compat_pid_t _pid;      /* sender's pid */
+                       __compat_uid32_t _uid;  /* sender's uid */
+                       compat_sigval_t _sigval;
+               } _rt;
+
+               /* SIGCHLD */
+               struct {
+                       compat_pid_t _pid;      /* which child */
+                       __compat_uid32_t _uid;  /* sender's uid */
+                       int _status;            /* exit code */
+                       compat_clock_t _utime;
+                       compat_clock_t _stime;
+               } _sigchld;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+               struct {
+                       compat_uptr_t _addr; /* faulting insn/memory ref. */
+                       short _addr_lsb; /* LSB of the reported address */
+               } _sigfault;
+
+               /* SIGPOLL */
+               struct {
+                       compat_long_t _band;    /* POLL_IN, POLL_OUT, POLL_MSG */
+                       int _fd;
+               } _sigpoll;
+       } _sifields;
+} compat_siginfo_t;
+
 #define COMPAT_OFF_T_MAX       0x7fffffff
 #define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
@@ -139,7 +198,6 @@ typedef u32         compat_sigset_word;
  * as pointers because the syscall entry code will have
  * appropriately converted them already.
  */
-typedef        u32             compat_uptr_t;
 
 static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
index ac74c2f261e3a0b953d79baf6681f90cc3c5e23b..0790a87a4346eb3b0d1825dcdfb599d828243b78 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
 
-typedef struct compat_siginfo {
-       int si_signo;
-       int si_errno;
-       int si_code;
-
-       union {
-               /* The padding is the same size as AArch64. */
-               int _pad[SI_PAD_SIZE];
-
-               /* kill() */
-               struct {
-                       compat_pid_t _pid;      /* sender's pid */
-                       __compat_uid32_t _uid;  /* sender's uid */
-               } _kill;
-
-               /* POSIX.1b timers */
-               struct {
-                       compat_timer_t _tid;    /* timer id */
-                       int _overrun;           /* overrun count */
-                       compat_sigval_t _sigval;        /* same as below */
-                       int _sys_private;       /* not to be passed to user */
-               } _timer;
-
-               /* POSIX.1b signals */
-               struct {
-                       compat_pid_t _pid;      /* sender's pid */
-                       __compat_uid32_t _uid;  /* sender's uid */
-                       compat_sigval_t _sigval;
-               } _rt;
-
-               /* SIGCHLD */
-               struct {
-                       compat_pid_t _pid;      /* which child */
-                       __compat_uid32_t _uid;  /* sender's uid */
-                       int _status;            /* exit code */
-                       compat_clock_t _utime;
-                       compat_clock_t _stime;
-               } _sigchld;
-
-               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
-               struct {
-                       compat_uptr_t _addr; /* faulting insn/memory ref. */
-                       short _addr_lsb; /* LSB of the reported address */
-               } _sigfault;
-
-               /* SIGPOLL */
-               struct {
-                       compat_long_t _band;    /* POLL_IN, POLL_OUT, POLL_MSG */
-                       int _fd;
-               } _sigpoll;
-       } _sifields;
-} compat_siginfo_t;
-
 struct compat_sigaction {
        compat_uptr_t                   sa_handler;
        compat_ulong_t                  sa_flags;
index 368a99e5c3e1e2213928fb27996252614ad7b848..6599a901b63ea20733ad9decf8bbebcc7ee8d8bd 100644 (file)
 
 #include <asm/uaccess.h>
 
-#define SI_PAD_SIZE32   ((SI_MAX_SIZE/sizeof(int)) - 3)
-
-typedef struct compat_siginfo {
-       int si_signo;
-       int si_code;
-       int si_errno;
-
-       union {
-               int _pad[SI_PAD_SIZE32];
-
-               /* kill() */
-               struct {
-                       compat_pid_t _pid;      /* sender's pid */
-                       compat_uid_t _uid;      /* sender's uid */
-               } _kill;
-
-               /* SIGCHLD */
-               struct {
-                       compat_pid_t _pid;      /* which child */
-                       compat_uid_t _uid;      /* sender's uid */
-                       int _status;            /* exit code */
-                       compat_clock_t _utime;
-                       compat_clock_t _stime;
-               } _sigchld;
-
-               /* IRIX SIGCHLD */
-               struct {
-                       compat_pid_t _pid;      /* which child */
-                       compat_clock_t _utime;
-                       int _status;            /* exit code */
-                       compat_clock_t _stime;
-               } _irix_sigchld;
-
-               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
-               struct {
-                       s32 _addr; /* faulting insn/memory ref. */
-               } _sigfault;
-
-               /* SIGPOLL, SIGXFSZ (To do ...)  */
-               struct {
-                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
-                       int _fd;
-               } _sigpoll;
-
-               /* POSIX.1b timers */
-               struct {
-                       timer_t _tid;           /* timer id */
-                       int _overrun;           /* overrun count */
-                       compat_sigval_t _sigval;/* same as below */
-                       int _sys_private;       /* not to be passed to user */
-               } _timer;
-
-               /* POSIX.1b signals */
-               struct {
-                       compat_pid_t _pid;      /* sender's pid */
-                       compat_uid_t _uid;      /* sender's uid */
-                       compat_sigval_t _sigval;
-               } _rt;
-
-       } _sifields;
-} compat_siginfo_t;
-
 static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d,
        const sigset_t *s)
 {
index b77df0366ee668296a03896e4ccd096329230dc9..58277e0e9cd4075e001f79e48fcaaf928dd53064 100644 (file)
@@ -43,6 +43,7 @@ typedef s64           compat_s64;
 typedef u32            compat_uint_t;
 typedef u32            compat_ulong_t;
 typedef u64            compat_u64;
+typedef u32            compat_uptr_t;
 
 struct compat_timespec {
        compat_time_t   tv_sec;
@@ -124,6 +125,73 @@ typedef u32                compat_old_sigset_t;    /* at least 32 bits */
 
 typedef u32            compat_sigset_word;
 
+typedef union compat_sigval {
+       compat_int_t    sival_int;
+       compat_uptr_t   sival_ptr;
+} compat_sigval_t;
+
+#define SI_PAD_SIZE32  (128/sizeof(int) - 3)
+
+typedef struct compat_siginfo {
+       int si_signo;
+       int si_code;
+       int si_errno;
+
+       union {
+               int _pad[SI_PAD_SIZE32];
+
+               /* kill() */
+               struct {
+                       compat_pid_t _pid;      /* sender's pid */
+                       __compat_uid_t _uid;    /* sender's uid */
+               } _kill;
+
+               /* SIGCHLD */
+               struct {
+                       compat_pid_t _pid;      /* which child */
+                       __compat_uid_t _uid;    /* sender's uid */
+                       int _status;            /* exit code */
+                       compat_clock_t _utime;
+                       compat_clock_t _stime;
+               } _sigchld;
+
+               /* IRIX SIGCHLD */
+               struct {
+                       compat_pid_t _pid;      /* which child */
+                       compat_clock_t _utime;
+                       int _status;            /* exit code */
+                       compat_clock_t _stime;
+               } _irix_sigchld;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+               struct {
+                       s32 _addr; /* faulting insn/memory ref. */
+               } _sigfault;
+
+               /* SIGPOLL, SIGXFSZ (To do ...)  */
+               struct {
+                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
+                       int _fd;
+               } _sigpoll;
+
+               /* POSIX.1b timers */
+               struct {
+                       timer_t _tid;           /* timer id */
+                       int _overrun;           /* overrun count */
+                       compat_sigval_t _sigval;/* same as below */
+                       int _sys_private;       /* not to be passed to user */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       compat_pid_t _pid;      /* sender's pid */
+                       __compat_uid_t _uid;    /* sender's uid */
+                       compat_sigval_t _sigval;
+               } _rt;
+
+       } _sifields;
+} compat_siginfo_t;
+
 #define COMPAT_OFF_T_MAX       0x7fffffff
 #define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
@@ -133,7 +201,6 @@ typedef u32         compat_sigset_word;
  * as pointers because the syscall entry code will have
  * appropriately converted them already.
  */
-typedef u32            compat_uptr_t;
 
 static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
index 760f331d4fa3e55c70685812a802dd1d2065259c..db7a662691a8b5cd1e6384a24fe4e19514734449 100644 (file)
@@ -36,6 +36,7 @@ typedef s64   compat_s64;
 typedef u32    compat_uint_t;
 typedef u32    compat_ulong_t;
 typedef u64    compat_u64;
+typedef u32    compat_uptr_t;
 
 struct compat_timespec {
        compat_time_t           tv_sec;
@@ -127,6 +128,63 @@ typedef u32                compat_old_sigset_t;    /* at least 32 bits */
 
 typedef u32            compat_sigset_word;
 
+typedef union compat_sigval {
+       compat_int_t    sival_int;
+       compat_uptr_t   sival_ptr;
+} compat_sigval_t;
+
+typedef struct compat_siginfo {
+       int si_signo;
+       int si_errno;
+       int si_code;
+
+       union {
+               int _pad[128/sizeof(int) - 3];
+
+               /* kill() */
+               struct {
+                       unsigned int _pid;      /* sender's pid */
+                       unsigned int _uid;      /* sender's uid */
+               } _kill;
+
+               /* POSIX.1b timers */
+               struct {
+                       compat_timer_t _tid;            /* timer id */
+                       int _overrun;           /* overrun count */
+                       char _pad[sizeof(unsigned int) - sizeof(int)];
+                       compat_sigval_t _sigval;        /* same as below */
+                       int _sys_private;       /* not to be passed to user */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       unsigned int _pid;      /* sender's pid */
+                       unsigned int _uid;      /* sender's uid */
+                       compat_sigval_t _sigval;
+               } _rt;
+
+               /* SIGCHLD */
+               struct {
+                       unsigned int _pid;      /* which child */
+                       unsigned int _uid;      /* sender's uid */
+                       int _status;            /* exit code */
+                       compat_clock_t _utime;
+                       compat_clock_t _stime;
+               } _sigchld;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+               struct {
+                       unsigned int _addr;     /* faulting insn/memory ref. */
+               } _sigfault;
+
+               /* SIGPOLL */
+               struct {
+                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
+                       int _fd;
+               } _sigpoll;
+       } _sifields;
+} compat_siginfo_t;
+
 #define COMPAT_OFF_T_MAX       0x7fffffff
 #define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
@@ -136,7 +194,6 @@ typedef u32         compat_sigset_word;
  * as pointers because the syscall entry code will have
  * appropriately converted them already.
  */
-typedef        u32             compat_uptr_t;
 
 static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
index c7800846422c3ba623372504437ced3ca0961c52..08a88b5349a277d4ed97d522526abb4ef4ed8096 100644 (file)
@@ -55,58 +55,6 @@ struct k_sigaction32 {
        struct compat_sigaction sa;
 };
 
-typedef struct compat_siginfo {
-        int si_signo;
-        int si_errno;
-        int si_code;
-
-        union {
-                int _pad[((128/sizeof(int)) - 3)];
-
-                /* kill() */
-                struct {
-                        unsigned int _pid;      /* sender's pid */
-                        unsigned int _uid;      /* sender's uid */
-                } _kill;
-
-                /* POSIX.1b timers */
-                struct {
-                        compat_timer_t _tid;            /* timer id */
-                        int _overrun;           /* overrun count */
-                        char _pad[sizeof(unsigned int) - sizeof(int)];
-                        compat_sigval_t _sigval;        /* same as below */
-                        int _sys_private;       /* not to be passed to user */
-                } _timer;
-
-                /* POSIX.1b signals */
-                struct {
-                        unsigned int _pid;      /* sender's pid */
-                        unsigned int _uid;      /* sender's uid */
-                        compat_sigval_t _sigval;
-                } _rt;
-
-                /* SIGCHLD */
-                struct {
-                        unsigned int _pid;      /* which child */
-                        unsigned int _uid;      /* sender's uid */
-                        int _status;            /* exit code */
-                        compat_clock_t _utime;
-                        compat_clock_t _stime;
-                } _sigchld;
-
-                /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
-                struct {
-                        unsigned int _addr;     /* faulting insn/memory ref. */
-                } _sigfault;
-
-                /* SIGPOLL */
-                struct {
-                        int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
-                        int _fd;
-                } _sigpoll;
-        } _sifields;
-} compat_siginfo_t;
-
 int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from);
 int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from);
 
index 88e602f6430d0b7575c69d2b109d003adb6d3949..84fdf6857c31d1ccf878911b416f32e104eba8fb 100644 (file)
@@ -38,6 +38,7 @@ typedef s64           compat_s64;
 typedef u32            compat_uint_t;
 typedef u32            compat_ulong_t;
 typedef u64            compat_u64;
+typedef u32            compat_uptr_t;
 
 struct compat_timespec {
        compat_time_t   tv_sec;
@@ -114,6 +115,64 @@ typedef u32                compat_old_sigset_t;
 
 typedef u32            compat_sigset_word;
 
+typedef union compat_sigval {
+       compat_int_t    sival_int;
+       compat_uptr_t   sival_ptr;
+} compat_sigval_t;
+
+#define SI_PAD_SIZE32  (128/sizeof(int) - 3)
+
+typedef struct compat_siginfo {
+       int si_signo;
+       int si_errno;
+       int si_code;
+
+       union {
+               int _pad[SI_PAD_SIZE32];
+
+               /* kill() */
+               struct {
+                       compat_pid_t _pid;              /* sender's pid */
+                       __compat_uid_t _uid;            /* sender's uid */
+               } _kill;
+
+               /* POSIX.1b timers */
+               struct {
+                       compat_timer_t _tid;            /* timer id */
+                       int _overrun;                   /* overrun count */
+                       compat_sigval_t _sigval;        /* same as below */
+                       int _sys_private;       /* not to be passed to user */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       compat_pid_t _pid;              /* sender's pid */
+                       __compat_uid_t _uid;            /* sender's uid */
+                       compat_sigval_t _sigval;
+               } _rt;
+
+               /* SIGCHLD */
+               struct {
+                       compat_pid_t _pid;              /* which child */
+                       __compat_uid_t _uid;            /* sender's uid */
+                       int _status;                    /* exit code */
+                       compat_clock_t _utime;
+                       compat_clock_t _stime;
+               } _sigchld;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
+               struct {
+                       unsigned int _addr; /* faulting insn/memory ref. */
+               } _sigfault;
+
+               /* SIGPOLL */
+               struct {
+                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
+                       int _fd;
+               } _sigpoll;
+       } _sifields;
+} compat_siginfo_t;
+
 #define COMPAT_OFF_T_MAX       0x7fffffff
 #define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
@@ -123,7 +182,6 @@ typedef u32         compat_sigset_word;
  * as pointers because the syscall entry code will have
  * appropriately converted them already.
  */
-typedef        u32             compat_uptr_t;
 
 static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
index 49495b0534edaf8499ab4e614dffef7819850dec..ccce3ef5cd8655a4bfbfba6e2e0153dae2651461 100644 (file)
@@ -10,7 +10,6 @@
 
 #ifdef __powerpc64__
 #    define __ARCH_SI_PREAMBLE_SIZE    (4 * sizeof(int))
-#    define SI_PAD_SIZE32              ((SI_MAX_SIZE/sizeof(int)) - 3)
 #endif
 
 #include <asm-generic/siginfo.h>
index dc16aefe1dd09876b5a98bffab73869ec52d860b..02fb0ee26093f53c07c494c3a1766bb267dca0de 100644 (file)
 
 /* These are here to support 32-bit syscalls on a 64-bit kernel. */
 
-typedef struct compat_siginfo {
-       int si_signo;
-       int si_errno;
-       int si_code;
-
-       union {
-               int _pad[SI_PAD_SIZE32];
-
-               /* kill() */
-               struct {
-                       compat_pid_t _pid;              /* sender's pid */
-                       compat_uid_t _uid;              /* sender's uid */
-               } _kill;
-
-               /* POSIX.1b timers */
-               struct {
-                       compat_timer_t _tid;                    /* timer id */
-                       int _overrun;                   /* overrun count */
-                       compat_sigval_t _sigval;                /* same as below */
-                       int _sys_private;               /* not to be passed to user */
-               } _timer;
-
-               /* POSIX.1b signals */
-               struct {
-                       compat_pid_t _pid;              /* sender's pid */
-                       compat_uid_t _uid;              /* sender's uid */
-                       compat_sigval_t _sigval;
-               } _rt;
-
-               /* SIGCHLD */
-               struct {
-                       compat_pid_t _pid;              /* which child */
-                       compat_uid_t _uid;              /* sender's uid */
-                       int _status;                    /* exit code */
-                       compat_clock_t _utime;
-                       compat_clock_t _stime;
-               } _sigchld;
-
-               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
-               struct {
-                       unsigned int _addr; /* faulting insn/memory ref. */
-               } _sigfault;
-
-               /* SIGPOLL */
-               struct {
-                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
-                       int _fd;
-               } _sigpoll;
-       } _sifields;
-} compat_siginfo_t;
-
 #define __old_sigaction32      old_sigaction32
 
 struct __old_sigaction32 {
index 234f1d859cea07c4f0cd31be401448fc8fe0870e..a34a9d612fc0f2d4ecc9a4bfbcef2794fba7de41 100644 (file)
@@ -65,6 +65,7 @@ typedef s64           compat_s64;
 typedef u32            compat_uint_t;
 typedef u32            compat_ulong_t;
 typedef u64            compat_u64;
+typedef u32            compat_uptr_t;
 
 struct compat_timespec {
        compat_time_t   tv_sec;
@@ -144,6 +145,79 @@ typedef u32                compat_old_sigset_t;    /* at least 32 bits */
 
 typedef u32            compat_sigset_word;
 
+typedef union compat_sigval {
+       compat_int_t    sival_int;
+       compat_uptr_t   sival_ptr;
+} compat_sigval_t;
+
+typedef struct compat_siginfo {
+       int     si_signo;
+       int     si_errno;
+       int     si_code;
+
+       union {
+               int _pad[128/sizeof(int) - 3];
+
+               /* kill() */
+               struct {
+                       pid_t   _pid;   /* sender's pid */
+                       uid_t   _uid;   /* sender's uid */
+               } _kill;
+
+               /* POSIX.1b timers */
+               struct {
+                       compat_timer_t _tid;            /* timer id */
+                       int _overrun;                   /* overrun count */
+                       compat_sigval_t _sigval;        /* same as below */
+                       int _sys_private;       /* not to be passed to user */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       pid_t                   _pid;   /* sender's pid */
+                       uid_t                   _uid;   /* sender's uid */
+                       compat_sigval_t         _sigval;
+               } _rt;
+
+               /* SIGCHLD */
+               struct {
+                       pid_t                   _pid;   /* which child */
+                       uid_t                   _uid;   /* sender's uid */
+                       int                     _status;/* exit code */
+                       compat_clock_t          _utime;
+                       compat_clock_t          _stime;
+               } _sigchld;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+               struct {
+                       __u32   _addr;  /* faulting insn/memory ref. - pointer */
+               } _sigfault;
+
+               /* SIGPOLL */
+               struct {
+                       int     _band;  /* POLL_IN, POLL_OUT, POLL_MSG */
+                       int     _fd;
+               } _sigpoll;
+       } _sifields;
+} compat_siginfo_t;
+
+/*
+ * How these fields are to be accessed.
+ */
+#define si_pid         _sifields._kill._pid
+#define si_uid         _sifields._kill._uid
+#define si_status      _sifields._sigchld._status
+#define si_utime       _sifields._sigchld._utime
+#define si_stime       _sifields._sigchld._stime
+#define si_value       _sifields._rt._sigval
+#define si_int         _sifields._rt._sigval.sival_int
+#define si_ptr         _sifields._rt._sigval.sival_ptr
+#define si_addr                _sifields._sigfault._addr
+#define si_band                _sifields._sigpoll._band
+#define si_fd          _sifields._sigpoll._fd
+#define si_tid         _sifields._timer._tid
+#define si_overrun     _sifields._timer._overrun
+
 #define COMPAT_OFF_T_MAX       0x7fffffff
 #define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
@@ -153,7 +227,6 @@ typedef u32         compat_sigset_word;
  * as pointers because the syscall entry code will have
  * appropriately converted them already.
  */
-typedef        u32             compat_uptr_t;
 
 static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
index 9635d759c2b9fbb107e39f326ff7b638bc353c36..90887bd98cf0b384ce91d2f1bc1ce7187e51498f 100644 (file)
@@ -23,74 +23,6 @@ struct old_sigaction32 {
        __u32                   sa_flags;
        __u32                   sa_restorer;    /* Another 32 bit pointer */
 };
-typedef struct compat_siginfo {
-       int     si_signo;
-       int     si_errno;
-       int     si_code;
-
-       union {
-               int _pad[((128/sizeof(int)) - 3)];
-
-               /* kill() */
-               struct {
-                       pid_t   _pid;   /* sender's pid */
-                       uid_t   _uid;   /* sender's uid */
-               } _kill;
-
-               /* POSIX.1b timers */
-               struct {
-                       compat_timer_t _tid;            /* timer id */
-                       int _overrun;           /* overrun count */
-                       compat_sigval_t _sigval;        /* same as below */
-                       int _sys_private;       /* not to be passed to user */
-               } _timer;
-
-               /* POSIX.1b signals */
-               struct {
-                       pid_t                   _pid;   /* sender's pid */
-                       uid_t                   _uid;   /* sender's uid */
-                       compat_sigval_t         _sigval;
-               } _rt;
-
-               /* SIGCHLD */
-               struct {
-                       pid_t                   _pid;   /* which child */
-                       uid_t                   _uid;   /* sender's uid */
-                       int                     _status;/* exit code */
-                       compat_clock_t          _utime;
-                       compat_clock_t          _stime;
-               } _sigchld;
-
-               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
-               struct {
-                       __u32   _addr;  /* faulting insn/memory ref. - pointer */
-               } _sigfault;
-                          
-               /* SIGPOLL */
-               struct {
-                       int     _band;  /* POLL_IN, POLL_OUT, POLL_MSG */
-                       int     _fd;
-               } _sigpoll;
-       } _sifields;
-} compat_siginfo_t;
-
-/*
- * How these fields are to be accessed.
- */
-#define si_pid         _sifields._kill._pid
-#define si_uid         _sifields._kill._uid
-#define si_status      _sifields._sigchld._status
-#define si_utime       _sifields._sigchld._utime
-#define si_stime       _sifields._sigchld._stime
-#define si_value       _sifields._rt._sigval
-#define si_int         _sifields._rt._sigval.sival_int
-#define si_ptr         _sifields._rt._sigval.sival_ptr
-#define si_addr                _sifields._sigfault._addr
-#define si_band                _sifields._sigpoll._band
-#define si_fd          _sifields._sigpoll._fd    
-#define si_tid         _sifields._timer._tid
-#define si_overrun     _sifields._timer._overrun
 
 /* asm/sigcontext.h */
 typedef union
index b8be20d42a0a8b89ab9d6ac261b445b64cbb8d1d..cef99fbc0a214b80721029fd826d1733f066868e 100644 (file)
@@ -36,6 +36,7 @@ typedef s64           compat_s64;
 typedef u32            compat_uint_t;
 typedef u32            compat_ulong_t;
 typedef u64            compat_u64;
+typedef u32            compat_uptr_t;
 
 struct compat_timespec {
        compat_time_t   tv_sec;
@@ -147,6 +148,65 @@ typedef u32                compat_old_sigset_t;
 
 typedef u32            compat_sigset_word;
 
+typedef union compat_sigval {
+       compat_int_t    sival_int;
+       compat_uptr_t   sival_ptr;
+} compat_sigval_t;
+
+#define SI_PAD_SIZE32  (128/sizeof(int) - 3)
+
+typedef struct compat_siginfo {
+       int si_signo;
+       int si_errno;
+       int si_code;
+
+       union {
+               int _pad[SI_PAD_SIZE32];
+
+               /* kill() */
+               struct {
+                       compat_pid_t _pid;              /* sender's pid */
+                       unsigned int _uid;              /* sender's uid */
+               } _kill;
+
+               /* POSIX.1b timers */
+               struct {
+                       compat_timer_t _tid;            /* timer id */
+                       int _overrun;                   /* overrun count */
+                       compat_sigval_t _sigval;        /* same as below */
+                       int _sys_private;       /* not to be passed to user */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       compat_pid_t _pid;              /* sender's pid */
+                       unsigned int _uid;              /* sender's uid */
+                       compat_sigval_t _sigval;
+               } _rt;
+
+               /* SIGCHLD */
+               struct {
+                       compat_pid_t _pid;              /* which child */
+                       unsigned int _uid;              /* sender's uid */
+                       int _status;                    /* exit code */
+                       compat_clock_t _utime;
+                       compat_clock_t _stime;
+               } _sigchld;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
+               struct {
+                       u32 _addr; /* faulting insn/memory ref. */
+                       int _trapno;
+               } _sigfault;
+
+               /* SIGPOLL */
+               struct {
+                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
+                       int _fd;
+               } _sigpoll;
+       } _sifields;
+} compat_siginfo_t;
+
 #define COMPAT_OFF_T_MAX       0x7fffffff
 #define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
@@ -156,7 +216,6 @@ typedef u32         compat_sigset_word;
  * as pointers because the syscall entry code will have
  * appropriately converted them already.
  */
-typedef        u32             compat_uptr_t;
 
 static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
index 215900fce21b0f4bfd637a83585a9540e30c4662..dbc182c438b494052d2f2aa51a9b001199472f10 100644 (file)
@@ -3,7 +3,6 @@
 
 #if defined(__sparc__) && defined(__arch64__)
 
-#define SI_PAD_SIZE32  ((SI_MAX_SIZE/sizeof(int)) - 3)
 #define __ARCH_SI_PREAMBLE_SIZE        (4 * sizeof(int))
 #define __ARCH_SI_BAND_T int
 
index a53e0a5fd3a3d944a5eb42391e2862c92a23c044..53e48f721ce3e0ceb122ac42550178e74886ad0e 100644 (file)
@@ -54,58 +54,6 @@ struct signal_frame32 {
        /* __siginfo_rwin_t * */u32 rwin_save;
 } __attribute__((aligned(8)));
 
-typedef struct compat_siginfo{
-       int si_signo;
-       int si_errno;
-       int si_code;
-
-       union {
-               int _pad[SI_PAD_SIZE32];
-
-               /* kill() */
-               struct {
-                       compat_pid_t _pid;              /* sender's pid */
-                       unsigned int _uid;              /* sender's uid */
-               } _kill;
-
-               /* POSIX.1b timers */
-               struct {
-                       compat_timer_t _tid;                    /* timer id */
-                       int _overrun;                   /* overrun count */
-                       compat_sigval_t _sigval;                /* same as below */
-                       int _sys_private;               /* not to be passed to user */
-               } _timer;
-
-               /* POSIX.1b signals */
-               struct {
-                       compat_pid_t _pid;              /* sender's pid */
-                       unsigned int _uid;              /* sender's uid */
-                       compat_sigval_t _sigval;
-               } _rt;
-
-               /* SIGCHLD */
-               struct {
-                       compat_pid_t _pid;              /* which child */
-                       unsigned int _uid;              /* sender's uid */
-                       int _status;                    /* exit code */
-                       compat_clock_t _utime;
-                       compat_clock_t _stime;
-               } _sigchld;
-
-               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
-               struct {
-                       u32 _addr; /* faulting insn/memory ref. */
-                       int _trapno;
-               } _sigfault;
-
-               /* SIGPOLL */
-               struct {
-                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
-                       int _fd;
-               } _sigpoll;
-       } _sifields;
-}compat_siginfo_t;
-
 struct rt_signal_frame32 {
        struct sparc_stackf32   ss;
        compat_siginfo_t        info;
index 6e74450ff0a110afc32901e273d74a77c80f8ca4..3063e6fc8daaa0dd3dd982a857889ffec74f451e 100644 (file)
@@ -110,6 +110,68 @@ struct compat_flock64 {
 
 typedef u32               compat_sigset_word;
 
+typedef union compat_sigval {
+       compat_int_t    sival_int;
+       compat_uptr_t   sival_ptr;
+} compat_sigval_t;
+
+#define COMPAT_SI_PAD_SIZE     (128/sizeof(int) - 3)
+
+typedef struct compat_siginfo {
+       int si_signo;
+       int si_errno;
+       int si_code;
+
+       union {
+               int _pad[COMPAT_SI_PAD_SIZE];
+
+               /* kill() */
+               struct {
+                       unsigned int _pid;      /* sender's pid */
+                       unsigned int _uid;      /* sender's uid */
+               } _kill;
+
+               /* POSIX.1b timers */
+               struct {
+                       compat_timer_t _tid;    /* timer id */
+                       int _overrun;           /* overrun count */
+                       compat_sigval_t _sigval;        /* same as below */
+                       int _sys_private;       /* not to be passed to user */
+                       int _overrun_incr;      /* amount to add to overrun */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       unsigned int _pid;      /* sender's pid */
+                       unsigned int _uid;      /* sender's uid */
+                       compat_sigval_t _sigval;
+               } _rt;
+
+               /* SIGCHLD */
+               struct {
+                       unsigned int _pid;      /* which child */
+                       unsigned int _uid;      /* sender's uid */
+                       int _status;            /* exit code */
+                       compat_clock_t _utime;
+                       compat_clock_t _stime;
+               } _sigchld;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+               struct {
+                       unsigned int _addr;     /* faulting insn/memory ref. */
+#ifdef __ARCH_SI_TRAPNO
+                       int _trapno;    /* TRAP # which caused the signal */
+#endif
+               } _sigfault;
+
+               /* SIGPOLL */
+               struct {
+                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
+                       int _fd;
+               } _sigpoll;
+       } _sifields;
+} compat_siginfo_t;
+
 #define COMPAT_OFF_T_MAX       0x7fffffff
 #define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
index 474571b8408584d37743678ce02b2ca77c3c9938..7bc0859a9f5ea688779266c10b967ad9f9a554ed 100644 (file)
@@ -55,63 +55,6 @@ struct compat_ucontext {
        sigset_t          uc_sigmask;   /* mask last for extensibility */
 };
 
-#define COMPAT_SI_PAD_SIZE     ((SI_MAX_SIZE - 3 * sizeof(int)) / sizeof(int))
-
-struct compat_siginfo {
-       int si_signo;
-       int si_errno;
-       int si_code;
-
-       union {
-               int _pad[COMPAT_SI_PAD_SIZE];
-
-               /* kill() */
-               struct {
-                       unsigned int _pid;      /* sender's pid */
-                       unsigned int _uid;      /* sender's uid */
-               } _kill;
-
-               /* POSIX.1b timers */
-               struct {
-                       compat_timer_t _tid;    /* timer id */
-                       int _overrun;           /* overrun count */
-                       compat_sigval_t _sigval;        /* same as below */
-                       int _sys_private;       /* not to be passed to user */
-                       int _overrun_incr;      /* amount to add to overrun */
-               } _timer;
-
-               /* POSIX.1b signals */
-               struct {
-                       unsigned int _pid;      /* sender's pid */
-                       unsigned int _uid;      /* sender's uid */
-                       compat_sigval_t _sigval;
-               } _rt;
-
-               /* SIGCHLD */
-               struct {
-                       unsigned int _pid;      /* which child */
-                       unsigned int _uid;      /* sender's uid */
-                       int _status;            /* exit code */
-                       compat_clock_t _utime;
-                       compat_clock_t _stime;
-               } _sigchld;
-
-               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
-               struct {
-                       unsigned int _addr;     /* faulting insn/memory ref. */
-#ifdef __ARCH_SI_TRAPNO
-                       int _trapno;    /* TRAP # which caused the signal */
-#endif
-               } _sigfault;
-
-               /* SIGPOLL */
-               struct {
-                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
-                       int _fd;
-               } _sigpoll;
-       } _sifields;
-};
-
 struct compat_rt_sigframe {
        unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; /* caller save area */
        struct compat_siginfo info;
index fedf32b73e65d8e288fc1bd4ed209212bd2c5163..59c6c401f79f16d9b98533275d66d437cbaeff0c 100644 (file)
@@ -41,6 +41,7 @@ typedef s64 __attribute__((aligned(4))) compat_s64;
 typedef u32            compat_uint_t;
 typedef u32            compat_ulong_t;
 typedef u64 __attribute__((aligned(4))) compat_u64;
+typedef u32            compat_uptr_t;
 
 struct compat_timespec {
        compat_time_t   tv_sec;
@@ -124,6 +125,78 @@ typedef u32                compat_old_sigset_t;    /* at least 32 bits */
 
 typedef u32               compat_sigset_word;
 
+typedef union compat_sigval {
+       compat_int_t    sival_int;
+       compat_uptr_t   sival_ptr;
+} compat_sigval_t;
+
+typedef struct compat_siginfo {
+       int si_signo;
+       int si_errno;
+       int si_code;
+
+       union {
+               int _pad[128/sizeof(int) - 3];
+
+               /* kill() */
+               struct {
+                       unsigned int _pid;      /* sender's pid */
+                       unsigned int _uid;      /* sender's uid */
+               } _kill;
+
+               /* POSIX.1b timers */
+               struct {
+                       compat_timer_t _tid;    /* timer id */
+                       int _overrun;           /* overrun count */
+                       compat_sigval_t _sigval;        /* same as below */
+                       int _sys_private;       /* not to be passed to user */
+                       int _overrun_incr;      /* amount to add to overrun */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       unsigned int _pid;      /* sender's pid */
+                       unsigned int _uid;      /* sender's uid */
+                       compat_sigval_t _sigval;
+               } _rt;
+
+               /* SIGCHLD */
+               struct {
+                       unsigned int _pid;      /* which child */
+                       unsigned int _uid;      /* sender's uid */
+                       int _status;            /* exit code */
+                       compat_clock_t _utime;
+                       compat_clock_t _stime;
+               } _sigchld;
+
+               /* SIGCHLD (x32 version) */
+               struct {
+                       unsigned int _pid;      /* which child */
+                       unsigned int _uid;      /* sender's uid */
+                       int _status;            /* exit code */
+                       compat_s64 _utime;
+                       compat_s64 _stime;
+               } _sigchld_x32;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+               struct {
+                       unsigned int _addr;     /* faulting insn/memory ref. */
+               } _sigfault;
+
+               /* SIGPOLL */
+               struct {
+                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
+                       int _fd;
+               } _sigpoll;
+
+               struct {
+                       unsigned int _call_addr; /* calling insn */
+                       int _syscall;   /* triggering system call number */
+                       unsigned int _arch;     /* AUDIT_ARCH_* of syscall */
+               } _sigsys;
+       } _sifields;
+} compat_siginfo_t;
+
 #define COMPAT_OFF_T_MAX       0x7fffffff
 #define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
@@ -209,7 +282,6 @@ typedef struct user_regs_struct32 compat_elf_gregset_t;
  * as pointers because the syscall entry code will have
  * appropriately converted them already.
  */
-typedef        u32             compat_uptr_t;
 
 static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
index b04cbdb138cd74017c5a38973a668413ea6671e0..e6232773ce4925dc790a2b6b41152393f80b84a1 100644 (file)
@@ -86,73 +86,6 @@ struct stat64 {
        unsigned long long      st_ino;
 } __attribute__((packed));
 
-typedef struct compat_siginfo {
-       int si_signo;
-       int si_errno;
-       int si_code;
-
-       union {
-               int _pad[((128 / sizeof(int)) - 3)];
-
-               /* kill() */
-               struct {
-                       unsigned int _pid;      /* sender's pid */
-                       unsigned int _uid;      /* sender's uid */
-               } _kill;
-
-               /* POSIX.1b timers */
-               struct {
-                       compat_timer_t _tid;    /* timer id */
-                       int _overrun;           /* overrun count */
-                       compat_sigval_t _sigval;        /* same as below */
-                       int _sys_private;       /* not to be passed to user */
-                       int _overrun_incr;      /* amount to add to overrun */
-               } _timer;
-
-               /* POSIX.1b signals */
-               struct {
-                       unsigned int _pid;      /* sender's pid */
-                       unsigned int _uid;      /* sender's uid */
-                       compat_sigval_t _sigval;
-               } _rt;
-
-               /* SIGCHLD */
-               struct {
-                       unsigned int _pid;      /* which child */
-                       unsigned int _uid;      /* sender's uid */
-                       int _status;            /* exit code */
-                       compat_clock_t _utime;
-                       compat_clock_t _stime;
-               } _sigchld;
-
-               /* SIGCHLD (x32 version) */
-               struct {
-                       unsigned int _pid;      /* which child */
-                       unsigned int _uid;      /* sender's uid */
-                       int _status;            /* exit code */
-                       compat_s64 _utime;
-                       compat_s64 _stime;
-               } _sigchld_x32;
-
-               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
-               struct {
-                       unsigned int _addr;     /* faulting insn/memory ref. */
-               } _sigfault;
-
-               /* SIGPOLL */
-               struct {
-                       int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
-                       int _fd;
-               } _sigpoll;
-
-               struct {
-                       unsigned int _call_addr; /* calling insn */
-                       int _syscall;   /* triggering system call number */
-                       unsigned int _arch;     /* AUDIT_ARCH_* of syscall */
-               } _sigsys;
-       } _sifields;
-} compat_siginfo_t;
-
 #define IA32_STACK_TOP IA32_PAGE_OFFSET
 
 #ifdef __KERNEL__
index fd4e29956d1c1d8069a085553bf1474e7b99ff7f..3f53d002c7c5c88521874e2e0085f0a083f2e7d1 100644 (file)
@@ -160,11 +160,6 @@ struct compat_ustat {
        char                    f_fpack[6];
 };
 
-typedef union compat_sigval {
-       compat_int_t    sival_int;
-       compat_uptr_t   sival_ptr;
-} compat_sigval_t;
-
 #define COMPAT_SIGEV_PAD_SIZE  ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
 
 typedef struct compat_sigevent {