diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-10-04 20:15:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:05:16 -0400 |
commit | 751f409db6216ebd134a94f6dcd97779933a5106 (patch) | |
tree | 7b059d89cf303ed2d37f36e8f8604e2295e3566a /arch/parisc | |
parent | 5ab1c309b344880d81494e9eab7fb27682bc6d9d (diff) |
compat: move compat_siginfo_t definition to asm/compat.h
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>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/include/asm/compat.h | 59 | ||||
-rw-r--r-- | arch/parisc/kernel/signal32.h | 52 |
2 files changed, 58 insertions, 53 deletions
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h index 760f331d4fa3..db7a662691a8 100644 --- a/arch/parisc/include/asm/compat.h +++ b/arch/parisc/include/asm/compat.h | |||
@@ -36,6 +36,7 @@ typedef s64 compat_s64; | |||
36 | typedef u32 compat_uint_t; | 36 | typedef u32 compat_uint_t; |
37 | typedef u32 compat_ulong_t; | 37 | typedef u32 compat_ulong_t; |
38 | typedef u64 compat_u64; | 38 | typedef u64 compat_u64; |
39 | typedef u32 compat_uptr_t; | ||
39 | 40 | ||
40 | struct compat_timespec { | 41 | struct compat_timespec { |
41 | compat_time_t tv_sec; | 42 | compat_time_t tv_sec; |
@@ -127,6 +128,63 @@ typedef u32 compat_old_sigset_t; /* at least 32 bits */ | |||
127 | 128 | ||
128 | typedef u32 compat_sigset_word; | 129 | typedef u32 compat_sigset_word; |
129 | 130 | ||
131 | typedef union compat_sigval { | ||
132 | compat_int_t sival_int; | ||
133 | compat_uptr_t sival_ptr; | ||
134 | } compat_sigval_t; | ||
135 | |||
136 | typedef struct compat_siginfo { | ||
137 | int si_signo; | ||
138 | int si_errno; | ||
139 | int si_code; | ||
140 | |||
141 | union { | ||
142 | int _pad[128/sizeof(int) - 3]; | ||
143 | |||
144 | /* kill() */ | ||
145 | struct { | ||
146 | unsigned int _pid; /* sender's pid */ | ||
147 | unsigned int _uid; /* sender's uid */ | ||
148 | } _kill; | ||
149 | |||
150 | /* POSIX.1b timers */ | ||
151 | struct { | ||
152 | compat_timer_t _tid; /* timer id */ | ||
153 | int _overrun; /* overrun count */ | ||
154 | char _pad[sizeof(unsigned int) - sizeof(int)]; | ||
155 | compat_sigval_t _sigval; /* same as below */ | ||
156 | int _sys_private; /* not to be passed to user */ | ||
157 | } _timer; | ||
158 | |||
159 | /* POSIX.1b signals */ | ||
160 | struct { | ||
161 | unsigned int _pid; /* sender's pid */ | ||
162 | unsigned int _uid; /* sender's uid */ | ||
163 | compat_sigval_t _sigval; | ||
164 | } _rt; | ||
165 | |||
166 | /* SIGCHLD */ | ||
167 | struct { | ||
168 | unsigned int _pid; /* which child */ | ||
169 | unsigned int _uid; /* sender's uid */ | ||
170 | int _status; /* exit code */ | ||
171 | compat_clock_t _utime; | ||
172 | compat_clock_t _stime; | ||
173 | } _sigchld; | ||
174 | |||
175 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
176 | struct { | ||
177 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
178 | } _sigfault; | ||
179 | |||
180 | /* SIGPOLL */ | ||
181 | struct { | ||
182 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
183 | int _fd; | ||
184 | } _sigpoll; | ||
185 | } _sifields; | ||
186 | } compat_siginfo_t; | ||
187 | |||
130 | #define COMPAT_OFF_T_MAX 0x7fffffff | 188 | #define COMPAT_OFF_T_MAX 0x7fffffff |
131 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 189 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
132 | 190 | ||
@@ -136,7 +194,6 @@ typedef u32 compat_sigset_word; | |||
136 | * as pointers because the syscall entry code will have | 194 | * as pointers because the syscall entry code will have |
137 | * appropriately converted them already. | 195 | * appropriately converted them already. |
138 | */ | 196 | */ |
139 | typedef u32 compat_uptr_t; | ||
140 | 197 | ||
141 | static inline void __user *compat_ptr(compat_uptr_t uptr) | 198 | static inline void __user *compat_ptr(compat_uptr_t uptr) |
142 | { | 199 | { |
diff --git a/arch/parisc/kernel/signal32.h b/arch/parisc/kernel/signal32.h index c7800846422c..08a88b5349a2 100644 --- a/arch/parisc/kernel/signal32.h +++ b/arch/parisc/kernel/signal32.h | |||
@@ -55,58 +55,6 @@ struct k_sigaction32 { | |||
55 | struct compat_sigaction sa; | 55 | struct compat_sigaction sa; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | typedef struct compat_siginfo { | ||
59 | int si_signo; | ||
60 | int si_errno; | ||
61 | int si_code; | ||
62 | |||
63 | union { | ||
64 | int _pad[((128/sizeof(int)) - 3)]; | ||
65 | |||
66 | /* kill() */ | ||
67 | struct { | ||
68 | unsigned int _pid; /* sender's pid */ | ||
69 | unsigned int _uid; /* sender's uid */ | ||
70 | } _kill; | ||
71 | |||
72 | /* POSIX.1b timers */ | ||
73 | struct { | ||
74 | compat_timer_t _tid; /* timer id */ | ||
75 | int _overrun; /* overrun count */ | ||
76 | char _pad[sizeof(unsigned int) - sizeof(int)]; | ||
77 | compat_sigval_t _sigval; /* same as below */ | ||
78 | int _sys_private; /* not to be passed to user */ | ||
79 | } _timer; | ||
80 | |||
81 | /* POSIX.1b signals */ | ||
82 | struct { | ||
83 | unsigned int _pid; /* sender's pid */ | ||
84 | unsigned int _uid; /* sender's uid */ | ||
85 | compat_sigval_t _sigval; | ||
86 | } _rt; | ||
87 | |||
88 | /* SIGCHLD */ | ||
89 | struct { | ||
90 | unsigned int _pid; /* which child */ | ||
91 | unsigned int _uid; /* sender's uid */ | ||
92 | int _status; /* exit code */ | ||
93 | compat_clock_t _utime; | ||
94 | compat_clock_t _stime; | ||
95 | } _sigchld; | ||
96 | |||
97 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
98 | struct { | ||
99 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
100 | } _sigfault; | ||
101 | |||
102 | /* SIGPOLL */ | ||
103 | struct { | ||
104 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
105 | int _fd; | ||
106 | } _sigpoll; | ||
107 | } _sifields; | ||
108 | } compat_siginfo_t; | ||
109 | |||
110 | int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from); | 58 | int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from); |
111 | int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from); | 59 | int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from); |
112 | 60 | ||