Skip to content

Commit

Permalink
microblaze: switch to generic sigaltstack
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Feb 3, 2013
1 parent 0aa0203 commit 4a9d32d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
1 change: 1 addition & 0 deletions arch/microblaze/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ config MICROBLAZE
select GENERIC_CLOCKEVENTS
select MODULES_USE_ELF_RELA
select CLONE_BACKWARDS
select GENERIC_SIGALTSTACK

config SWAP
def_bool n
Expand Down
17 changes: 2 additions & 15 deletions arch/microblaze/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@
#include <asm/cacheflush.h>
#include <asm/syscalls.h>

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

/*
* Do a signal return; undo the signal stack.
*/
Expand Down Expand Up @@ -109,9 +102,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval))
goto badframe;

/* It is more difficult to avoid calling this function than to
call it and ignore errors. */
if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->r1) == -EFAULT)
if (restore_altstack(&frame->uc.uc_stack))
goto badframe;

return rval;
Expand Down Expand Up @@ -194,11 +185,7 @@ static int 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(NULL, &frame->uc.uc_link);
err |= __put_user((void __user *)current->sas_ss_sp,
&frame->uc.uc_stack.ss_sp);
err |= __put_user(sas_ss_flags(regs->r1),
&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, regs->r1);
err |= setup_sigcontext(&frame->uc.uc_mcontext,
regs, set->sig[0]);
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
Expand Down

0 comments on commit 4a9d32d

Please sign in to comment.