Commit 9a8c1359 authored by Richard Weinberger's avatar Richard Weinberger

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: default avatarRichard Weinberger <richard@nod.at>
parent 74735341
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
#ifndef __FRAME_KERN_H_ #ifndef __FRAME_KERN_H_
#define __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 k_sigaction *ka,
struct pt_regs *regs, struct pt_regs *regs,
sigset_t *mask); 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 k_sigaction *ka,
struct pt_regs *regs, siginfo_t *info, struct pt_regs *regs, struct siginfo *info,
sigset_t *mask); sigset_t *mask);
#endif #endif
......
...@@ -19,7 +19,7 @@ EXPORT_SYMBOL(unblock_signals); ...@@ -19,7 +19,7 @@ EXPORT_SYMBOL(unblock_signals);
* OK, we're invoking a handler * OK, we're invoking a handler
*/ */
static void handle_signal(struct pt_regs *regs, unsigned long signr, 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(); sigset_t *oldset = sigmask_to_save();
int singlestep = 0; int singlestep = 0;
...@@ -71,7 +71,7 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr, ...@@ -71,7 +71,7 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr,
static int kern_do_signal(struct pt_regs *regs) static int kern_do_signal(struct pt_regs *regs)
{ {
struct k_sigaction ka_copy; struct k_sigaction ka_copy;
siginfo_t info; struct siginfo info;
int sig, handled_sig = 0; int sig, handled_sig = 0;
while ((sig = get_signal_to_deliver(&info, &ka_copy, regs, NULL)) > 0) { while ((sig = get_signal_to_deliver(&info, &ka_copy, regs, NULL)) > 0) {
......
...@@ -25,7 +25,7 @@ void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = { ...@@ -25,7 +25,7 @@ void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
[SIGIO] = sigio_handler, [SIGIO] = sigio_handler,
[SIGVTALRM] = timer_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; struct uml_pt_regs r;
int save_errno = errno; int save_errno = errno;
...@@ -61,7 +61,7 @@ static void sig_handler_common(int sig, siginfo_t *si, mcontext_t *mc) ...@@ -61,7 +61,7 @@ static void sig_handler_common(int sig, siginfo_t *si, mcontext_t *mc)
static int signals_enabled; static int signals_enabled;
static unsigned int signals_pending; 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; int enabled;
...@@ -120,7 +120,7 @@ void set_sigstack(void *sig_stack, int size) ...@@ -120,7 +120,7 @@ void set_sigstack(void *sig_stack, int size)
panic("enabling signal stack failed, errno = %d\n", errno); 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, [SIGSEGV] = sig_handler,
[SIGBUS] = sig_handler, [SIGBUS] = sig_handler,
[SIGILL] = sig_handler, [SIGILL] = sig_handler,
...@@ -162,7 +162,7 @@ static void hard_handler(int sig, siginfo_t *si, void *p) ...@@ -162,7 +162,7 @@ static void hard_handler(int sig, siginfo_t *si, void *p)
while ((sig = ffs(pending)) != 0){ while ((sig = ffs(pending)) != 0){
sig--; sig--;
pending &= ~(1 << sig); pending &= ~(1 << sig);
(*handlers[sig])(sig, si, mc); (*handlers[sig])(sig, (struct siginfo *)si, mc);
} }
/* /*
......
...@@ -414,7 +414,7 @@ void userspace(struct uml_pt_regs *regs) ...@@ -414,7 +414,7 @@ void userspace(struct uml_pt_regs *regs)
if (WIFSTOPPED(status)) { if (WIFSTOPPED(status)) {
int sig = WSTOPSIG(status); int sig = WSTOPSIG(status);
ptrace(PTRACE_GETSIGINFO, pid, 0, &si); ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
switch (sig) { switch (sig) {
case SIGSEGV: case SIGSEGV:
...@@ -422,7 +422,7 @@ void userspace(struct uml_pt_regs *regs) ...@@ -422,7 +422,7 @@ void userspace(struct uml_pt_regs *regs)
!ptrace_faultinfo) { !ptrace_faultinfo) {
get_skas_faultinfo(pid, get_skas_faultinfo(pid,
&regs->faultinfo); &regs->faultinfo);
(*sig_info[SIGSEGV])(SIGSEGV, &si, (*sig_info[SIGSEGV])(SIGSEGV, (struct siginfo *)&si,
regs); regs);
} }
else handle_segv(pid, regs); else handle_segv(pid, regs);
...@@ -431,14 +431,14 @@ void userspace(struct uml_pt_regs *regs) ...@@ -431,14 +431,14 @@ void userspace(struct uml_pt_regs *regs)
handle_trap(pid, regs, local_using_sysemu); handle_trap(pid, regs, local_using_sysemu);
break; break;
case SIGTRAP: case SIGTRAP:
relay_signal(SIGTRAP, &si, regs); relay_signal(SIGTRAP, (struct siginfo *)&si, regs);
break; break;
case SIGVTALRM: case SIGVTALRM:
now = os_nsecs(); now = os_nsecs();
if (now < nsecs) if (now < nsecs)
break; break;
block_signals(); block_signals();
(*sig_info[sig])(sig, &si, regs); (*sig_info[sig])(sig, (struct siginfo *)&si, regs);
unblock_signals(); unblock_signals();
nsecs = timer.it_value.tv_sec * nsecs = timer.it_value.tv_sec *
UM_NSEC_PER_SEC + UM_NSEC_PER_SEC +
...@@ -452,7 +452,7 @@ void userspace(struct uml_pt_regs *regs) ...@@ -452,7 +452,7 @@ void userspace(struct uml_pt_regs *regs)
case SIGFPE: case SIGFPE:
case SIGWINCH: case SIGWINCH:
block_signals(); block_signals();
(*sig_info[sig])(sig, &si, regs); (*sig_info[sig])(sig, (struct siginfo *)&si, regs);
unblock_signals(); unblock_signals();
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment