Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295303
b: refs/heads/master
c: e933c70
h: refs/heads/master
i:
  295301: 6835b83
  295299: 9664d3a
  295295: ff6249b
v: v3
  • Loading branch information
Matt Fleming authored and Jonas Bonn committed Feb 17, 2012
1 parent 5305117 commit 4ac6208
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b675eeb743abaa0b99a35c1fd32fea8e13a17d32
refs/heads/master: e933c70de0e2590d41f5edd3133e7ee12b4e0bc6
29 changes: 18 additions & 11 deletions trunk/arch/openrisc/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ static inline void __user *get_sigframe(struct k_sigaction *ka,
* trampoline which performs the syscall sigreturn, or a provided
* user-mode trampoline.
*/
static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs)
static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs)
{
struct rt_sigframe *frame;
unsigned long return_ip;
Expand Down Expand Up @@ -247,18 +247,23 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
/* actually move the usp to reflect the stacked frame */
regs->sp = (unsigned long)frame;

return;
return 0;

give_sigsegv:
force_sigsegv(sig, current);
return -EFAULT;
}

static inline void
static inline int
handle_signal(unsigned long sig,
siginfo_t *info, struct k_sigaction *ka,
sigset_t *oldset, struct pt_regs *regs)
{
setup_rt_frame(sig, ka, info, oldset, regs);
int ret;

ret = setup_rt_frame(sig, ka, info, oldset, regs);
if (ret)
return ret;

spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
Expand All @@ -267,6 +272,8 @@ handle_signal(unsigned long sig,
recalc_sigpending();

spin_unlock_irq(&current->sighand->siglock);

return 0;
}

/*
Expand Down Expand Up @@ -355,13 +362,13 @@ void do_signal(struct pt_regs *regs)
oldset = &current->blocked;

/* Whee! Actually deliver the signal. */
handle_signal(signr, &info, &ka, oldset, regs);
/* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag */
if (test_thread_flag(TIF_RESTORE_SIGMASK))
if (!handle_signal(signr, &info, &ka, oldset, regs)) {
/* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag */
clear_thread_flag(TIF_RESTORE_SIGMASK);
}

tracehook_signal_handler(signr, &info, &ka, regs,
test_thread_flag(TIF_SINGLESTEP));
Expand Down

0 comments on commit 4ac6208

Please sign in to comment.