Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16362
b: refs/heads/master
c: 8efc0ab
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Jan 6, 2006
1 parent 81b007a commit 6f32c5d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 30 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: 7ee1dd3fee22f15728f545d266403fc977e1eb99
refs/heads/master: 8efc0ab50edbac5c65191b8a58dfdab3741b7901
2 changes: 1 addition & 1 deletion trunk/arch/frv/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ __entry_work_notifysig:
LEDS 0x6410
ori.p gr4,#0,gr8
call do_notify_resume
bra __entry_return_direct
bra __entry_resume_userspace

# perform syscall entry tracing
__syscall_trace_entry:
Expand Down
73 changes: 45 additions & 28 deletions trunk/arch/frv/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ static inline void __user *get_sigframe(struct k_sigaction *ka,
/*
*
*/
static void setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs * regs)
static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
struct pt_regs *regs)
{
struct sigframe __user *frame;
int rsig;
Expand Down Expand Up @@ -362,26 +363,30 @@ static void setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, struct p

set_fs(USER_DS);

/* the tracer may want to single-step inside the handler */
if (test_thread_flag(TIF_SINGLESTEP))
ptrace_notify(SIGTRAP);

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

return;
return 1;

give_sigsegv:
if (sig == SIGSEGV)
ka->sa.sa_handler = SIG_DFL;

force_sig(SIGSEGV, current);
return 0;

} /* end setup_frame() */

/*****************************************************************************/
/*
*
*/
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 __user *frame;
int rsig;
Expand Down Expand Up @@ -457,28 +462,34 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,

set_fs(USER_DS);

/* the tracer may want to single-step inside the handler */
if (test_thread_flag(TIF_SINGLESTEP))
ptrace_notify(SIGTRAP);

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

return;
return 1;

give_sigsegv:
if (sig == SIGSEGV)
ka->sa.sa_handler = SIG_DFL;
force_sig(SIGSEGV, current);
return 0;

} /* end setup_rt_frame() */

/*****************************************************************************/
/*
* OK, we're invoking a handler
*/
static void handle_signal(unsigned long sig, siginfo_t *info,
struct k_sigaction *ka, sigset_t *oldset,
struct pt_regs *regs)
static int handle_signal(unsigned long sig, siginfo_t *info,
struct k_sigaction *ka, sigset_t *oldset,
struct pt_regs *regs)
{
int ret;

/* Are we from a system call? */
if (in_syscall(regs)) {
/* If so, check system call restarting.. */
Expand All @@ -493,6 +504,7 @@ static void handle_signal(unsigned long sig, siginfo_t *info,
regs->gr8 = -EINTR;
break;
}

/* fallthrough */
case -ERESTARTNOINTR:
regs->gr8 = regs->orig_gr8;
Expand All @@ -502,16 +514,22 @@ static void handle_signal(unsigned long sig, siginfo_t *info,

/* Set up the stack frame */
if (ka->sa.sa_flags & SA_SIGINFO)
setup_rt_frame(sig, ka, info, oldset, regs);
ret = setup_rt_frame(sig, ka, info, oldset, regs);
else
setup_frame(sig, ka, oldset, regs);
ret = setup_frame(sig, ka, oldset, regs);

if (ret) {
spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked, &current->blocked,
&ka->sa.sa_mask);
if (!(ka->sa.sa_flags & SA_NODEFER))
sigaddset(&current->blocked, sig);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
}

return ret;

spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
if (!(ka->sa.sa_flags & SA_NODEFER))
sigaddset(&current->blocked, sig);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
} /* end handle_signal() */

/*****************************************************************************/
Expand Down Expand Up @@ -542,12 +560,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
oldset = &current->blocked;

signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) {
handle_signal(signr, &info, &ka, oldset, regs);
return 1;
}
if (signr > 0)
return handle_signal(signr, &info, &ka, oldset, regs);

no_signal:
no_signal:
/* Did we come from a system call? */
if (regs->syscallno >= 0) {
/* Restart the system call - no handlers present */
Expand All @@ -565,6 +581,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
}

return 0;

} /* end do_signal() */

/*****************************************************************************/
Expand Down

0 comments on commit 6f32c5d

Please sign in to comment.