Skip to content

Commit d00d920

Browse files
Amanieuralfbaechle
authored andcommitted
MIPS: Clean up compat_siginfo_t
While mips can't use the generic compat_siginfo_t directly because its si_code and si_errno are inverted, we can still make it as close to the generic version as possible. This makes it easier to update when new members are added to siginfo_t. The main changes are adding a missing _sigsys union member and eliminating the unused _irix_sigchld one. Signed-off-by: Amanieu d'Antras <amanieu@gmail.com> Cc: linux-kernel@vger.kernel.org Cc: Oleg Nesterov <oleg@redhat.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11455/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 22b1452 commit d00d920

1 file changed

Lines changed: 34 additions & 28 deletions

File tree

arch/mips/include/asm/compat.h

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ typedef union compat_sigval {
130130
compat_uptr_t sival_ptr;
131131
} compat_sigval_t;
132132

133+
/* Can't use the generic version because si_code and si_errno are swapped */
134+
133135
#define SI_PAD_SIZE32 (128/sizeof(int) - 3)
134136

135137
typedef struct compat_siginfo {
@@ -138,57 +140,61 @@ typedef struct compat_siginfo {
138140
int si_errno;
139141

140142
union {
141-
int _pad[SI_PAD_SIZE32];
143+
int _pad[128 / sizeof(int) - 3];
142144

143145
/* kill() */
144146
struct {
145147
compat_pid_t _pid; /* sender's pid */
146-
__compat_uid_t _uid; /* sender's uid */
148+
__compat_uid32_t _uid; /* sender's uid */
147149
} _kill;
148150

151+
/* POSIX.1b timers */
152+
struct {
153+
compat_timer_t _tid; /* timer id */
154+
int _overrun; /* overrun count */
155+
compat_sigval_t _sigval; /* same as below */
156+
} _timer;
157+
158+
/* POSIX.1b signals */
159+
struct {
160+
compat_pid_t _pid; /* sender's pid */
161+
__compat_uid32_t _uid; /* sender's uid */
162+
compat_sigval_t _sigval;
163+
} _rt;
164+
149165
/* SIGCHLD */
150166
struct {
151167
compat_pid_t _pid; /* which child */
152-
__compat_uid_t _uid; /* sender's uid */
168+
__compat_uid32_t _uid; /* sender's uid */
153169
int _status; /* exit code */
154170
compat_clock_t _utime;
155171
compat_clock_t _stime;
156172
} _sigchld;
157173

158-
/* IRIX SIGCHLD */
159-
struct {
160-
compat_pid_t _pid; /* which child */
161-
compat_clock_t _utime;
162-
int _status; /* exit code */
163-
compat_clock_t _stime;
164-
} _irix_sigchld;
165-
166174
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
167175
struct {
168-
s32 _addr; /* faulting insn/memory ref. */
176+
compat_uptr_t _addr; /* faulting insn/memory ref. */
177+
#ifdef __ARCH_SI_TRAPNO
178+
int _trapno; /* TRAP # which caused the signal */
179+
#endif
180+
short _addr_lsb; /* LSB of the reported address */
181+
struct {
182+
compat_uptr_t _lower;
183+
compat_uptr_t _upper;
184+
} _addr_bnd;
169185
} _sigfault;
170186

171-
/* SIGPOLL, SIGXFSZ (To do ...) */
187+
/* SIGPOLL */
172188
struct {
173-
int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
189+
compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */
174190
int _fd;
175191
} _sigpoll;
176192

177-
/* POSIX.1b timers */
178-
struct {
179-
timer_t _tid; /* timer id */
180-
int _overrun; /* overrun count */
181-
compat_sigval_t _sigval;/* same as below */
182-
int _sys_private; /* not to be passed to user */
183-
} _timer;
184-
185-
/* POSIX.1b signals */
186193
struct {
187-
compat_pid_t _pid; /* sender's pid */
188-
__compat_uid_t _uid; /* sender's uid */
189-
compat_sigval_t _sigval;
190-
} _rt;
191-
194+
compat_uptr_t _call_addr; /* calling insn */
195+
int _syscall; /* triggering system call number */
196+
compat_uint_t _arch; /* AUDIT_ARCH_* of syscall */
197+
} _sigsys;
192198
} _sifields;
193199
} compat_siginfo_t;
194200

0 commit comments

Comments
 (0)