Skip to content

Commit b713da6

Browse files
Al Viroebiederm
authored andcommitted
signal: unify compat_siginfo_t
--EWB Added #ifdef CONFIG_X86_X32_ABI to arch/x86/kernel/signal_compat.c Changed #ifdef CONFIG_X86_X32 to #ifdef CONFIG_X86_X32_ABI in linux/compat.h CONFIG_X86_X32 is set when the user requests X32 support. CONFIG_X86_X32_ABI is set when the user requests X32 support and the tool-chain has X32 allowing X32 support to be built. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
1 parent 4795477 commit b713da6

File tree

10 files changed

+94
-525
lines changed

10 files changed

+94
-525
lines changed

arch/arm64/include/asm/compat.h

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -150,69 +150,6 @@ typedef u32 compat_old_sigset_t;
150150

151151
typedef u32 compat_sigset_word;
152152

153-
typedef union compat_sigval {
154-
compat_int_t sival_int;
155-
compat_uptr_t sival_ptr;
156-
} compat_sigval_t;
157-
158-
typedef struct compat_siginfo {
159-
int si_signo;
160-
int si_errno;
161-
int si_code;
162-
163-
union {
164-
int _pad[128/sizeof(int) - 3];
165-
166-
/* kill() */
167-
struct {
168-
compat_pid_t _pid; /* sender's pid */
169-
__compat_uid32_t _uid; /* sender's uid */
170-
} _kill;
171-
172-
/* POSIX.1b timers */
173-
struct {
174-
compat_timer_t _tid; /* timer id */
175-
int _overrun; /* overrun count */
176-
compat_sigval_t _sigval; /* same as below */
177-
} _timer;
178-
179-
/* POSIX.1b signals */
180-
struct {
181-
compat_pid_t _pid; /* sender's pid */
182-
__compat_uid32_t _uid; /* sender's uid */
183-
compat_sigval_t _sigval;
184-
} _rt;
185-
186-
/* SIGCHLD */
187-
struct {
188-
compat_pid_t _pid; /* which child */
189-
__compat_uid32_t _uid; /* sender's uid */
190-
int _status; /* exit code */
191-
compat_clock_t _utime;
192-
compat_clock_t _stime;
193-
} _sigchld;
194-
195-
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
196-
struct {
197-
compat_uptr_t _addr; /* faulting insn/memory ref. */
198-
short _addr_lsb; /* LSB of the reported address */
199-
} _sigfault;
200-
201-
/* SIGPOLL */
202-
struct {
203-
compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */
204-
int _fd;
205-
} _sigpoll;
206-
207-
/* SIGSYS */
208-
struct {
209-
compat_uptr_t _call_addr; /* calling user insn */
210-
int _syscall; /* triggering system call number */
211-
compat_uint_t _arch; /* AUDIT_ARCH_* of syscall */
212-
} _sigsys;
213-
} _sifields;
214-
} compat_siginfo_t;
215-
216153
#define COMPAT_OFF_T_MAX 0x7fffffff
217154

218155
/*

arch/mips/include/asm/compat.h

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -126,79 +126,8 @@ typedef u32 compat_old_sigset_t; /* at least 32 bits */
126126

127127
typedef u32 compat_sigset_word;
128128

129-
typedef union compat_sigval {
130-
compat_int_t sival_int;
131-
compat_uptr_t sival_ptr;
132-
} compat_sigval_t;
133-
134-
/* Can't use the generic version because si_code and si_errno are swapped */
135-
136129
#define SI_PAD_SIZE32 (128/sizeof(int) - 3)
137130

138-
typedef struct compat_siginfo {
139-
int si_signo;
140-
int si_code;
141-
int si_errno;
142-
143-
union {
144-
int _pad[128 / sizeof(int) - 3];
145-
146-
/* kill() */
147-
struct {
148-
compat_pid_t _pid; /* sender's pid */
149-
__compat_uid32_t _uid; /* sender's uid */
150-
} _kill;
151-
152-
/* POSIX.1b timers */
153-
struct {
154-
compat_timer_t _tid; /* timer id */
155-
int _overrun; /* overrun count */
156-
compat_sigval_t _sigval; /* same as below */
157-
} _timer;
158-
159-
/* POSIX.1b signals */
160-
struct {
161-
compat_pid_t _pid; /* sender's pid */
162-
__compat_uid32_t _uid; /* sender's uid */
163-
compat_sigval_t _sigval;
164-
} _rt;
165-
166-
/* SIGCHLD */
167-
struct {
168-
compat_pid_t _pid; /* which child */
169-
__compat_uid32_t _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-
compat_uptr_t _addr; /* faulting insn/memory ref. */
178-
#ifdef __ARCH_SI_TRAPNO
179-
int _trapno; /* TRAP # which caused the signal */
180-
#endif
181-
short _addr_lsb; /* LSB of the reported address */
182-
struct {
183-
compat_uptr_t _lower;
184-
compat_uptr_t _upper;
185-
} _addr_bnd;
186-
} _sigfault;
187-
188-
/* SIGPOLL */
189-
struct {
190-
compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */
191-
int _fd;
192-
} _sigpoll;
193-
194-
struct {
195-
compat_uptr_t _call_addr; /* calling insn */
196-
int _syscall; /* triggering system call number */
197-
compat_uint_t _arch; /* AUDIT_ARCH_* of syscall */
198-
} _sigsys;
199-
} _sifields;
200-
} compat_siginfo_t;
201-
202131
#define COMPAT_OFF_T_MAX 0x7fffffff
203132

204133
/*

arch/parisc/include/asm/compat.h

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -130,69 +130,6 @@ typedef u32 compat_old_sigset_t; /* at least 32 bits */
130130

131131
typedef u32 compat_sigset_word;
132132

133-
typedef union compat_sigval {
134-
compat_int_t sival_int;
135-
compat_uptr_t sival_ptr;
136-
} compat_sigval_t;
137-
138-
typedef struct compat_siginfo {
139-
int si_signo;
140-
int si_errno;
141-
int si_code;
142-
143-
union {
144-
int _pad[128/sizeof(int) - 3];
145-
146-
/* kill() */
147-
struct {
148-
unsigned int _pid; /* sender's pid */
149-
unsigned int _uid; /* sender's uid */
150-
} _kill;
151-
152-
/* POSIX.1b timers */
153-
struct {
154-
compat_timer_t _tid; /* timer id */
155-
int _overrun; /* overrun count */
156-
char _pad[sizeof(unsigned int) - sizeof(int)];
157-
compat_sigval_t _sigval; /* same as below */
158-
} _timer;
159-
160-
/* POSIX.1b signals */
161-
struct {
162-
unsigned int _pid; /* sender's pid */
163-
unsigned int _uid; /* sender's uid */
164-
compat_sigval_t _sigval;
165-
} _rt;
166-
167-
/* SIGCHLD */
168-
struct {
169-
unsigned int _pid; /* which child */
170-
unsigned int _uid; /* sender's uid */
171-
int _status; /* exit code */
172-
compat_clock_t _utime;
173-
compat_clock_t _stime;
174-
} _sigchld;
175-
176-
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
177-
struct {
178-
unsigned int _addr; /* faulting insn/memory ref. */
179-
} _sigfault;
180-
181-
/* SIGPOLL */
182-
struct {
183-
int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
184-
int _fd;
185-
} _sigpoll;
186-
187-
/* SIGSYS */
188-
struct {
189-
compat_uptr_t _call_addr; /* calling user insn */
190-
int _syscall; /* triggering system call number */
191-
compat_uint_t _arch; /* AUDIT_ARCH_* of syscall */
192-
} _sigsys;
193-
} _sifields;
194-
} compat_siginfo_t;
195-
196133
#define COMPAT_OFF_T_MAX 0x7fffffff
197134

198135
struct compat_ipc64_perm {

arch/powerpc/include/asm/compat.h

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -119,70 +119,8 @@ typedef u32 compat_old_sigset_t;
119119

120120
typedef u32 compat_sigset_word;
121121

122-
typedef union compat_sigval {
123-
compat_int_t sival_int;
124-
compat_uptr_t sival_ptr;
125-
} compat_sigval_t;
126-
127122
#define SI_PAD_SIZE32 (128/sizeof(int) - 3)
128123

129-
typedef struct compat_siginfo {
130-
int si_signo;
131-
int si_errno;
132-
int si_code;
133-
134-
union {
135-
int _pad[SI_PAD_SIZE32];
136-
137-
/* kill() */
138-
struct {
139-
compat_pid_t _pid; /* sender's pid */
140-
__compat_uid_t _uid; /* sender's uid */
141-
} _kill;
142-
143-
/* POSIX.1b timers */
144-
struct {
145-
compat_timer_t _tid; /* timer id */
146-
int _overrun; /* overrun count */
147-
compat_sigval_t _sigval; /* same as below */
148-
} _timer;
149-
150-
/* POSIX.1b signals */
151-
struct {
152-
compat_pid_t _pid; /* sender's pid */
153-
__compat_uid_t _uid; /* sender's uid */
154-
compat_sigval_t _sigval;
155-
} _rt;
156-
157-
/* SIGCHLD */
158-
struct {
159-
compat_pid_t _pid; /* which child */
160-
__compat_uid_t _uid; /* sender's uid */
161-
int _status; /* exit code */
162-
compat_clock_t _utime;
163-
compat_clock_t _stime;
164-
} _sigchld;
165-
166-
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
167-
struct {
168-
unsigned int _addr; /* faulting insn/memory ref. */
169-
} _sigfault;
170-
171-
/* SIGPOLL */
172-
struct {
173-
int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
174-
int _fd;
175-
} _sigpoll;
176-
177-
/* SIGSYS */
178-
struct {
179-
unsigned int _call_addr; /* calling insn */
180-
int _syscall; /* triggering system call number */
181-
unsigned int _arch; /* AUDIT_ARCH_* of syscall */
182-
} _sigsys;
183-
} _sifields;
184-
} compat_siginfo_t;
185-
186124
#define COMPAT_OFF_T_MAX 0x7fffffff
187125

188126
/*

arch/s390/include/asm/compat.h

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -189,78 +189,6 @@ typedef u32 compat_old_sigset_t; /* at least 32 bits */
189189

190190
typedef u32 compat_sigset_word;
191191

192-
typedef union compat_sigval {
193-
compat_int_t sival_int;
194-
compat_uptr_t sival_ptr;
195-
} compat_sigval_t;
196-
197-
typedef struct compat_siginfo {
198-
int si_signo;
199-
int si_errno;
200-
int si_code;
201-
202-
union {
203-
int _pad[128/sizeof(int) - 3];
204-
205-
/* kill() */
206-
struct {
207-
pid_t _pid; /* sender's pid */
208-
uid_t _uid; /* sender's uid */
209-
} _kill;
210-
211-
/* POSIX.1b timers */
212-
struct {
213-
compat_timer_t _tid; /* timer id */
214-
int _overrun; /* overrun count */
215-
compat_sigval_t _sigval; /* same as below */
216-
} _timer;
217-
218-
/* POSIX.1b signals */
219-
struct {
220-
pid_t _pid; /* sender's pid */
221-
uid_t _uid; /* sender's uid */
222-
compat_sigval_t _sigval;
223-
} _rt;
224-
225-
/* SIGCHLD */
226-
struct {
227-
pid_t _pid; /* which child */
228-
uid_t _uid; /* sender's uid */
229-
int _status;/* exit code */
230-
compat_clock_t _utime;
231-
compat_clock_t _stime;
232-
} _sigchld;
233-
234-
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
235-
struct {
236-
__u32 _addr; /* faulting insn/memory ref. - pointer */
237-
} _sigfault;
238-
239-
/* SIGPOLL */
240-
struct {
241-
int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
242-
int _fd;
243-
} _sigpoll;
244-
} _sifields;
245-
} compat_siginfo_t;
246-
247-
/*
248-
* How these fields are to be accessed.
249-
*/
250-
#define si_pid _sifields._kill._pid
251-
#define si_uid _sifields._kill._uid
252-
#define si_status _sifields._sigchld._status
253-
#define si_utime _sifields._sigchld._utime
254-
#define si_stime _sifields._sigchld._stime
255-
#define si_value _sifields._rt._sigval
256-
#define si_int _sifields._rt._sigval.sival_int
257-
#define si_ptr _sifields._rt._sigval.sival_ptr
258-
#define si_addr _sifields._sigfault._addr
259-
#define si_band _sifields._sigpoll._band
260-
#define si_fd _sifields._sigpoll._fd
261-
#define si_tid _sifields._timer._tid
262-
#define si_overrun _sifields._timer._overrun
263-
264192
#define COMPAT_OFF_T_MAX 0x7fffffff
265193

266194
/*

0 commit comments

Comments
 (0)