avr32: switch to generic sigaltstack

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2012-12-23 02:00:08 -05:00
Родитель 0aa0203fb4
Коммит 4788069501
4 изменённых файлов: 4 добавлений и 20 удалений

Просмотреть файл

@ -17,6 +17,7 @@ config AVR32
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_SIGALTSTACK
help help
AVR32 is a high-performance 32-bit RISC microprocessor core, AVR32 is a high-performance 32-bit RISC microprocessor core,
designed for cost-sensitive embedded applications, with particular designed for cost-sensitive embedded applications, with particular

Просмотреть файл

@ -21,12 +21,6 @@
#include <asm/ucontext.h> #include <asm/ucontext.h>
#include <asm/syscalls.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 rt_sigframe
{ {
struct siginfo info; struct siginfo info;
@ -91,7 +85,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe; goto badframe;
if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT) if (restore_altstack(&frame->uc.uc_stack))
goto badframe; goto badframe;
pr_debug("Context restored: pc = %08lx, lr = %08lx, sp = %08lx\n", pr_debug("Context restored: pc = %08lx, lr = %08lx, sp = %08lx\n",
@ -175,12 +169,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
/* Set up the ucontext */ /* Set up the ucontext */
err |= __put_user(0, &frame->uc.uc_flags); err |= __put_user(0, &frame->uc.uc_flags);
err |= __put_user(NULL, &frame->uc.uc_link); err |= __put_user(NULL, &frame->uc.uc_link);
err |= __put_user((void __user *)current->sas_ss_sp, err |= __save_altstack(&frame->uc.uc_stack, regs->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 |= setup_sigcontext(&frame->uc.uc_mcontext, regs);
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));

Просмотреть файл

@ -20,12 +20,6 @@ __sys_rt_sigsuspend:
mov r10, sp mov r10, sp
rjmp sys_rt_sigsuspend rjmp sys_rt_sigsuspend
.global __sys_sigaltstack
.type __sys_sigaltstack,@function
__sys_sigaltstack:
mov r10, sp
rjmp sys_sigaltstack
.global __sys_rt_sigreturn .global __sys_rt_sigreturn
.type __sys_rt_sigreturn,@function .type __sys_rt_sigreturn,@function
__sys_rt_sigreturn: __sys_rt_sigreturn:

Просмотреть файл

@ -115,7 +115,7 @@ sys_call_table:
.long sys_statfs .long sys_statfs
.long sys_fstatfs /* 100 */ .long sys_fstatfs /* 100 */
.long sys_vhangup .long sys_vhangup
.long __sys_sigaltstack .long sys_sigaltstack
.long sys_syslog .long sys_syslog
.long sys_setitimer .long sys_setitimer
.long sys_getitimer /* 105 */ .long sys_getitimer /* 105 */