Skip to content

Commit

Permalink
um: siginfo cleanup
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
richardweinberger committed Jul 19, 2013
1 parent 7473534 commit 9a8c135
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions arch/um/include/shared/frame_kern.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
#ifndef __FRAME_KERN_H_
#define __FRAME_KERN_H_

extern int setup_signal_stack_sc(unsigned long stack_top, int sig,
extern int setup_signal_stack_sc(unsigned long stack_top, int sig,
struct k_sigaction *ka,
struct pt_regs *regs,
struct pt_regs *regs,
sigset_t *mask);
extern int setup_signal_stack_si(unsigned long stack_top, int sig,
extern int setup_signal_stack_si(unsigned long stack_top, int sig,
struct k_sigaction *ka,
struct pt_regs *regs, siginfo_t *info,
struct pt_regs *regs, struct siginfo *info,
sigset_t *mask);

#endif
Expand Down
4 changes: 2 additions & 2 deletions arch/um/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ EXPORT_SYMBOL(unblock_signals);
* OK, we're invoking a handler
*/
static void handle_signal(struct pt_regs *regs, unsigned long signr,
struct k_sigaction *ka, siginfo_t *info)
struct k_sigaction *ka, struct siginfo *info)
{
sigset_t *oldset = sigmask_to_save();
int singlestep = 0;
Expand Down Expand Up @@ -71,7 +71,7 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr,
static int kern_do_signal(struct pt_regs *regs)
{
struct k_sigaction ka_copy;
siginfo_t info;
struct siginfo info;
int sig, handled_sig = 0;

while ((sig = get_signal_to_deliver(&info, &ka_copy, regs, NULL)) > 0) {
Expand Down
8 changes: 4 additions & 4 deletions arch/um/os-Linux/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
[SIGIO] = sigio_handler,
[SIGVTALRM] = timer_handler };

static void sig_handler_common(int sig, siginfo_t *si, mcontext_t *mc)
static void sig_handler_common(int sig, struct siginfo *si, mcontext_t *mc)
{
struct uml_pt_regs r;
int save_errno = errno;
Expand Down Expand Up @@ -61,7 +61,7 @@ static void sig_handler_common(int sig, siginfo_t *si, mcontext_t *mc)
static int signals_enabled;
static unsigned int signals_pending;

void sig_handler(int sig, siginfo_t *si, mcontext_t *mc)
void sig_handler(int sig, struct siginfo *si, mcontext_t *mc)
{
int enabled;

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

static void (*handlers[_NSIG])(int sig, siginfo_t *si, mcontext_t *mc) = {
static void (*handlers[_NSIG])(int sig, struct siginfo *si, mcontext_t *mc) = {
[SIGSEGV] = sig_handler,
[SIGBUS] = sig_handler,
[SIGILL] = sig_handler,
Expand Down Expand Up @@ -162,7 +162,7 @@ static void hard_handler(int sig, siginfo_t *si, void *p)
while ((sig = ffs(pending)) != 0){
sig--;
pending &= ~(1 << sig);
(*handlers[sig])(sig, si, mc);
(*handlers[sig])(sig, (struct siginfo *)si, mc);
}

/*
Expand Down
10 changes: 5 additions & 5 deletions arch/um/os-Linux/skas/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,15 @@ void userspace(struct uml_pt_regs *regs)
if (WIFSTOPPED(status)) {
int sig = WSTOPSIG(status);

ptrace(PTRACE_GETSIGINFO, pid, 0, &si);
ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);

switch (sig) {
case SIGSEGV:
if (PTRACE_FULL_FAULTINFO ||
!ptrace_faultinfo) {
get_skas_faultinfo(pid,
&regs->faultinfo);
(*sig_info[SIGSEGV])(SIGSEGV, &si,
(*sig_info[SIGSEGV])(SIGSEGV, (struct siginfo *)&si,
regs);
}
else handle_segv(pid, regs);
Expand All @@ -431,14 +431,14 @@ void userspace(struct uml_pt_regs *regs)
handle_trap(pid, regs, local_using_sysemu);
break;
case SIGTRAP:
relay_signal(SIGTRAP, &si, regs);
relay_signal(SIGTRAP, (struct siginfo *)&si, regs);
break;
case SIGVTALRM:
now = os_nsecs();
if (now < nsecs)
break;
block_signals();
(*sig_info[sig])(sig, &si, regs);
(*sig_info[sig])(sig, (struct siginfo *)&si, regs);
unblock_signals();
nsecs = timer.it_value.tv_sec *
UM_NSEC_PER_SEC +
Expand All @@ -452,7 +452,7 @@ void userspace(struct uml_pt_regs *regs)
case SIGFPE:
case SIGWINCH:
block_signals();
(*sig_info[sig])(sig, &si, regs);
(*sig_info[sig])(sig, (struct siginfo *)&si, regs);
unblock_signals();
break;
default:
Expand Down

0 comments on commit 9a8c135

Please sign in to comment.