Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356671
b: refs/heads/master
c: 79d4321
h: refs/heads/master
i:
  356669: efc86f1
  356667: d3def89
  356663: e948991
  356655: d2b320c
  356639: 10cd975
  356607: 818a787
v: v3
  • Loading branch information
Al Viro committed Feb 3, 2013
1 parent 267f0ea commit 9e023ce
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 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: 47880695011964be808d3151f0f47bd6626f6f2f
refs/heads/master: 79d432103c6dc4ed46adc8e1f53d34e8ba7089c0
1 change: 0 additions & 1 deletion trunk/arch/avr32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ config AVR32
select GENERIC_CLOCKEVENTS
select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA
select GENERIC_SIGALTSTACK
help
AVR32 is a high-performance 32-bit RISC microprocessor core,
designed for cost-sensitive embedded applications, with particular
Expand Down
15 changes: 13 additions & 2 deletions trunk/arch/avr32/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#include <asm/ucontext.h>
#include <asm/syscalls.h>

asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
struct pt_regs *regs)
{
return do_sigaltstack(uss, uoss, regs->sp);
}

struct rt_sigframe
{
struct siginfo info;
Expand Down Expand Up @@ -85,7 +91,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe;

if (restore_altstack(&frame->uc.uc_stack))
if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT)
goto badframe;

pr_debug("Context restored: pc = %08lx, lr = %08lx, sp = %08lx\n",
Expand Down Expand Up @@ -169,7 +175,12 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
/* Set up the ucontext */
err |= __put_user(0, &frame->uc.uc_flags);
err |= __put_user(NULL, &frame->uc.uc_link);
err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
err |= __put_user((void __user *)current->sas_ss_sp,
&frame->uc.uc_stack.ss_sp);
err |= __put_user(sas_ss_flags(regs->sp),
&frame->uc.uc_stack.ss_flags);
err |= __put_user(current->sas_ss_size,
&frame->uc.uc_stack.ss_size);
err |= setup_sigcontext(&frame->uc.uc_mcontext, regs);
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));

Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/avr32/kernel/syscall-stubs.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ __sys_rt_sigsuspend:
mov r10, sp
rjmp sys_rt_sigsuspend

.global __sys_sigaltstack
.type __sys_sigaltstack,@function
__sys_sigaltstack:
mov r10, sp
rjmp sys_sigaltstack

.global __sys_rt_sigreturn
.type __sys_rt_sigreturn,@function
__sys_rt_sigreturn:
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/avr32/kernel/syscall_table.S
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ sys_call_table:
.long sys_statfs
.long sys_fstatfs /* 100 */
.long sys_vhangup
.long sys_sigaltstack
.long __sys_sigaltstack
.long sys_syslog
.long sys_setitimer
.long sys_getitimer /* 105 */
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/blackfin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ config BLACKFIN
select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA
select GENERIC_SIGALTSTACK

config GENERIC_CSUM
def_bool y
Expand Down
12 changes: 2 additions & 10 deletions trunk/arch/blackfin/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ struct rt_sigframe {
struct ucontext uc;
};

asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
{
return do_sigaltstack(uss, uoss, rdusp());
}

static inline int
rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *pr0)
{
Expand Down Expand Up @@ -100,7 +95,7 @@ asmlinkage int sys_rt_sigreturn(void)
if (rt_restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0))
goto badframe;

if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->usp) == -EFAULT)
if (restore_altstack(&frame->uc.uc_stack))
goto badframe;

return r0;
Expand Down Expand Up @@ -178,10 +173,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info,
/* Create the ucontext. */
err |= __put_user(0, &frame->uc.uc_flags);
err |= __put_user(0, &frame->uc.uc_link);
err |=
__put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
err |= __put_user(sas_ss_flags(rdusp()), &frame->uc.uc_stack.ss_flags);
err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
err |= __save_altstack(&frame->uc.uc_stack, rdusp());
err |= rt_setup_sigcontext(&frame->uc.uc_mcontext, regs);
err |= copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));

Expand Down

0 comments on commit 9e023ce

Please sign in to comment.