Skip to content

Commit 9a8c135

Browse files
um: siginfo cleanup
Currently we use both struct siginfo and siginfo_t. Let's use struct siginfo internally to avoid ongoing compiler warning. We are allowed to do so because struct siginfo and siginfo_t are equivalent. Signed-off-by: Richard Weinberger <[email protected]>
1 parent 7473534 commit 9a8c135

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

arch/um/include/shared/frame_kern.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#ifndef __FRAME_KERN_H_
77
#define __FRAME_KERN_H_
88

9-
extern int setup_signal_stack_sc(unsigned long stack_top, int sig,
9+
extern int setup_signal_stack_sc(unsigned long stack_top, int sig,
1010
struct k_sigaction *ka,
11-
struct pt_regs *regs,
11+
struct pt_regs *regs,
1212
sigset_t *mask);
13-
extern int setup_signal_stack_si(unsigned long stack_top, int sig,
13+
extern int setup_signal_stack_si(unsigned long stack_top, int sig,
1414
struct k_sigaction *ka,
15-
struct pt_regs *regs, siginfo_t *info,
15+
struct pt_regs *regs, struct siginfo *info,
1616
sigset_t *mask);
1717

1818
#endif

arch/um/kernel/signal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ EXPORT_SYMBOL(unblock_signals);
1919
* OK, we're invoking a handler
2020
*/
2121
static void handle_signal(struct pt_regs *regs, unsigned long signr,
22-
struct k_sigaction *ka, siginfo_t *info)
22+
struct k_sigaction *ka, struct siginfo *info)
2323
{
2424
sigset_t *oldset = sigmask_to_save();
2525
int singlestep = 0;
@@ -71,7 +71,7 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr,
7171
static int kern_do_signal(struct pt_regs *regs)
7272
{
7373
struct k_sigaction ka_copy;
74-
siginfo_t info;
74+
struct siginfo info;
7575
int sig, handled_sig = 0;
7676

7777
while ((sig = get_signal_to_deliver(&info, &ka_copy, regs, NULL)) > 0) {

arch/um/os-Linux/signal.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
2525
[SIGIO] = sigio_handler,
2626
[SIGVTALRM] = timer_handler };
2727

28-
static void sig_handler_common(int sig, siginfo_t *si, mcontext_t *mc)
28+
static void sig_handler_common(int sig, struct siginfo *si, mcontext_t *mc)
2929
{
3030
struct uml_pt_regs r;
3131
int save_errno = errno;
@@ -61,7 +61,7 @@ static void sig_handler_common(int sig, siginfo_t *si, mcontext_t *mc)
6161
static int signals_enabled;
6262
static unsigned int signals_pending;
6363

64-
void sig_handler(int sig, siginfo_t *si, mcontext_t *mc)
64+
void sig_handler(int sig, struct siginfo *si, mcontext_t *mc)
6565
{
6666
int enabled;
6767

@@ -120,7 +120,7 @@ void set_sigstack(void *sig_stack, int size)
120120
panic("enabling signal stack failed, errno = %d\n", errno);
121121
}
122122

123-
static void (*handlers[_NSIG])(int sig, siginfo_t *si, mcontext_t *mc) = {
123+
static void (*handlers[_NSIG])(int sig, struct siginfo *si, mcontext_t *mc) = {
124124
[SIGSEGV] = sig_handler,
125125
[SIGBUS] = sig_handler,
126126
[SIGILL] = sig_handler,
@@ -162,7 +162,7 @@ static void hard_handler(int sig, siginfo_t *si, void *p)
162162
while ((sig = ffs(pending)) != 0){
163163
sig--;
164164
pending &= ~(1 << sig);
165-
(*handlers[sig])(sig, si, mc);
165+
(*handlers[sig])(sig, (struct siginfo *)si, mc);
166166
}
167167

168168
/*

arch/um/os-Linux/skas/process.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,15 @@ void userspace(struct uml_pt_regs *regs)
414414
if (WIFSTOPPED(status)) {
415415
int sig = WSTOPSIG(status);
416416

417-
ptrace(PTRACE_GETSIGINFO, pid, 0, &si);
417+
ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
418418

419419
switch (sig) {
420420
case SIGSEGV:
421421
if (PTRACE_FULL_FAULTINFO ||
422422
!ptrace_faultinfo) {
423423
get_skas_faultinfo(pid,
424424
&regs->faultinfo);
425-
(*sig_info[SIGSEGV])(SIGSEGV, &si,
425+
(*sig_info[SIGSEGV])(SIGSEGV, (struct siginfo *)&si,
426426
regs);
427427
}
428428
else handle_segv(pid, regs);
@@ -431,14 +431,14 @@ void userspace(struct uml_pt_regs *regs)
431431
handle_trap(pid, regs, local_using_sysemu);
432432
break;
433433
case SIGTRAP:
434-
relay_signal(SIGTRAP, &si, regs);
434+
relay_signal(SIGTRAP, (struct siginfo *)&si, regs);
435435
break;
436436
case SIGVTALRM:
437437
now = os_nsecs();
438438
if (now < nsecs)
439439
break;
440440
block_signals();
441-
(*sig_info[sig])(sig, &si, regs);
441+
(*sig_info[sig])(sig, (struct siginfo *)&si, regs);
442442
unblock_signals();
443443
nsecs = timer.it_value.tv_sec *
444444
UM_NSEC_PER_SEC +
@@ -452,7 +452,7 @@ void userspace(struct uml_pt_regs *regs)
452452
case SIGFPE:
453453
case SIGWINCH:
454454
block_signals();
455-
(*sig_info[sig])(sig, &si, regs);
455+
(*sig_info[sig])(sig, (struct siginfo *)&si, regs);
456456
unblock_signals();
457457
break;
458458
default:

0 commit comments

Comments
 (0)