Skip to content
Permalink
Browse files
Fix of Linux signals for LM32 arch
  • Loading branch information
Sergey Koulik authored and Sebastien Bourdeauducq committed Mar 12, 2012
1 parent 329e85e commit c03a5b5ecbe69f0503a3f9c6db3c250382268f9c
Showing with 16 additions and 1 deletion.
  1. +16 −1 arch/lm32/kernel/signal.c
@@ -49,6 +49,7 @@
#include <linux/personality.h>
#include <linux/tty.h>
#include <linux/hardirq.h>
#include <linux/freezer.h>

#include <asm/uaccess.h>
#include <asm/ucontext.h>
@@ -189,7 +190,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka,

#if DEBUG_SIG
printk("SIG deliver (%s:%d): frame=%p, sp=%p ra=%08lx ea=%08lx, signal(r1)=%d\n",
current->comm, current->pid, frame, regs->sp, regs->ra, regs->ea, signal);
current->comm, current->pid, frame, regs->sp, regs->ra, regs->ea, sig);
#endif

return regs->r1;
@@ -235,18 +236,28 @@ static int do_signal(int retval, struct pt_regs *regs)
* kernel mode. Just return without doing anything
* if so.
*/
if (!user_mode(regs))
return 0;

if (try_to_freeze())
goto no_signal;

if (test_thread_flag(TIF_RESTORE_SIGMASK))
oldset = &current->saved_sigmask;
else
oldset = &current->blocked;

signr = get_signal_to_deliver(&info, &ka, regs, NULL);

if (signr > 0) {
/* Whee! Actually deliver the signal. */
handle_signal(signr, &info, &ka, oldset, regs);
if (test_thread_flag(TIF_RESTORE_SIGMASK))
clear_thread_flag(TIF_RESTORE_SIGMASK);
return signr;
}

no_signal:
/* Did we come from a system call? */
if (regs->r8) {
/* Restart the system call - no handlers present */
@@ -261,6 +272,10 @@ static int do_signal(int retval, struct pt_regs *regs)
regs->ea -= 4; /* Size of scall insn. */
}
}
if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
clear_thread_flag(TIF_RESTORE_SIGMASK);
sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
}

return retval;
}

0 comments on commit c03a5b5

Please sign in to comment.