aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2012-04-23 19:29:18 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2012-04-23 19:29:18 -0400
commitd643bdca8ab9cd333da1b68267d0e47328e56f56 (patch)
tree59fa93e4f8e51fcbd862aeeef25d026d19c18459 /include
parent98e5272fe70d62e193f70acf9951667beab27aba (diff)
asm-generic: Allow overriding clock_t and add attributes to siginfo_t
For the particular issue of x32, which shares code with i386 in the handling of compat_siginfo_t, the use of a 64-bit clock_t bumps the sigchld structure out of alignment, which triggers a messy cascade of padding. This was already handled on the kernel compat side, but it needs handling on the user space side, which uses the generic header. To make that possible: 1. Allow __kernel_clock_t to be overridden in struct siginfo; 2. Allow there to be attributes added to struct siginfo. Reported-by: H.J. Lu <hjl.rools@gmail.com> Cc: Bruce J. Beare <bruce.j.beare@intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Link: http://lkml.kernel.org/r/CAMe9rOqF6Kh6-NK7oP0Fpzkd4SBAWU%2BG53hwBbSD4iA2UzyxuA@mail.gmail.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/siginfo.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h
index 0dd4e87f6fba..5e5e3865f1ed 100644
--- a/include/asm-generic/siginfo.h
+++ b/include/asm-generic/siginfo.h
@@ -35,6 +35,14 @@ typedef union sigval {
35#define __ARCH_SI_BAND_T long 35#define __ARCH_SI_BAND_T long
36#endif 36#endif
37 37
38#ifndef __ARCH_SI_CLOCK_T
39#define __ARCH_SI_CLOCK_T __kernel_clock_t
40#endif
41
42#ifndef __ARCH_SI_ATTRIBUTES
43#define __ARCH_SI_ATTRIBUTES
44#endif
45
38#ifndef HAVE_ARCH_SIGINFO_T 46#ifndef HAVE_ARCH_SIGINFO_T
39 47
40typedef struct siginfo { 48typedef struct siginfo {
@@ -72,8 +80,8 @@ typedef struct siginfo {
72 __kernel_pid_t _pid; /* which child */ 80 __kernel_pid_t _pid; /* which child */
73 __ARCH_SI_UID_T _uid; /* sender's uid */ 81 __ARCH_SI_UID_T _uid; /* sender's uid */
74 int _status; /* exit code */ 82 int _status; /* exit code */
75 __kernel_clock_t _utime; 83 __ARCH_SI_CLOCK_T _utime;
76 __kernel_clock_t _stime; 84 __ARCH_SI_CLOCK_T _stime;
77 } _sigchld; 85 } _sigchld;
78 86
79 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 87 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
@@ -91,7 +99,7 @@ typedef struct siginfo {
91 int _fd; 99 int _fd;
92 } _sigpoll; 100 } _sigpoll;
93 } _sifields; 101 } _sifields;
94} siginfo_t; 102} __ARCH_SI_ATTRIBUTES siginfo_t;
95 103
96#endif 104#endif
97 105