Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356743
b: refs/heads/master
c: 7a879a9
h: refs/heads/master
i:
  356741: 0810056
  356739: 3d7d3a9
  356735: 07eef1e
v: v3
  • Loading branch information
Al Viro committed Feb 3, 2013
1 parent 6bf4f26 commit e391cbb
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 42 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: b774cc5cb6b3b53b276bb7d968e3579afc2922c5
refs/heads/master: 7a879a94d90dc5c494875b54499ae321400358d8
1 change: 0 additions & 1 deletion trunk/arch/score/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ config SCORE
select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_REL
select CLONE_BACKWARDS
select GENERIC_SIGALTSTACK

choice
prompt "System type"
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/score/include/asm/syscalls.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _ASM_SCORE_SYSCALLS_H
#define _ASM_SCORE_SYSCALLS_H

asmlinkage long score_sigaltstack(struct pt_regs *regs);
asmlinkage long score_rt_sigreturn(struct pt_regs *regs);

#include <asm-generic/syscalls.h>
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/score/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,8 @@ ENTRY(sys_rt_sigreturn)
mv r4, r0
la r8, score_rt_sigreturn
br r8

ENTRY(sys_sigaltstack)
mv r4, r0
la r8, score_sigaltstack
br r8
21 changes: 19 additions & 2 deletions trunk/arch/score/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ static void __user *get_sigframe(struct k_sigaction *ka,
return (void __user*)((sp - frame_size) & ~7);
}

asmlinkage long
score_sigaltstack(struct pt_regs *regs)
{
const stack_t __user *uss = (const stack_t __user *) regs->regs[4];
stack_t __user *uoss = (stack_t __user *) regs->regs[5];
unsigned long usp = regs->regs[0];

return do_sigaltstack(uss, uoss, usp);
}

asmlinkage long
score_rt_sigreturn(struct pt_regs *regs)
{
Expand All @@ -157,7 +167,9 @@ score_rt_sigreturn(struct pt_regs *regs)
else if (sig)
force_sig(sig, current);

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

Expand Down Expand Up @@ -197,7 +209,12 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
err |= copy_siginfo_to_user(&frame->rs_info, info);
err |= __put_user(0, &frame->rs_uc.uc_flags);
err |= __put_user(NULL, &frame->rs_uc.uc_link);
err |= __save_altstack(&frame->rs_uc.uc_stack, regs->regs[0]);
err |= __put_user((void __user *)current->sas_ss_sp,
&frame->rs_uc.uc_stack.ss_sp);
err |= __put_user(sas_ss_flags(regs->regs[0]),
&frame->rs_uc.uc_stack.ss_flags);
err |= __put_user(current->sas_ss_size,
&frame->rs_uc.uc_stack.ss_size);
err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext);
err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set));

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ config SUPERH
select GENERIC_STRNLEN_USER
select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
select MODULES_USE_ELF_RELA
select GENERIC_SIGALTSTACK
help
The SuperH is a RISC processor targeted for use in embedded systems
and consumer electronics; it was also used in the Sega Dreamcast
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/sh/include/asm/syscalls_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ struct pt_regs;
asmlinkage int sys_sigsuspend(old_sigset_t mask);
asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act,
struct old_sigaction __user *oact);
asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7,
struct pt_regs __regs);
Expand Down
20 changes: 2 additions & 18 deletions trunk/arch/sh/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
return ret;
}

asmlinkage int
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
unsigned long r6, unsigned long r7,
struct pt_regs __regs)
{
struct pt_regs *regs = RELOC_HIDE(&__regs, 0);

return do_sigaltstack(uss, uoss, regs->regs[15]);
}


/*
* Do a signal return; undo the signal stack.
*/
Expand Down Expand Up @@ -257,8 +246,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0))
goto badframe;

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

return r0;
Expand Down Expand Up @@ -423,11 +411,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 *)current->sas_ss_sp,
&frame->uc.uc_stack.ss_sp);
err |= __put_user(sas_ss_flags(regs->regs[15]),
&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->regs[15]);
err |= setup_sigcontext(&frame->uc.uc_mcontext,
regs, set->sig[0]);
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
Expand Down
19 changes: 2 additions & 17 deletions trunk/arch/sh/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
return ret;
}

asmlinkage int
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
unsigned long r4, unsigned long r5, unsigned long r6,
unsigned long r7,
struct pt_regs * regs)
{
return do_sigaltstack(uss, uoss, REF_REG_SP);
}

/*
* Do a signal return; undo the signal stack.
*/
Expand Down Expand Up @@ -364,9 +355,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3,
goto badframe;
regs->pc -= 4;

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

return (int) ret;
Expand Down Expand Up @@ -560,11 +549,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(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(regs->regs[REG_SP]),
&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->regs[REG_SP]);
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 e391cbb

Please sign in to comment.