Skip to content

Commit

Permalink
x86: signal: cosmetic unification of sys_sigaltstack()
Browse files Browse the repository at this point in the history
Impact: cleanup

Add #ifdef directive for unification.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Hiroshi Shimamoto authored and Ingo Molnar committed Nov 23, 2008
1 parent 5c9b3a0 commit 666ac7b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/x86/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
return ret;
}

#ifdef CONFIG_X86_32
asmlinkage int sys_sigaltstack(unsigned long bx)
{
/*
Expand All @@ -137,6 +138,14 @@ asmlinkage int sys_sigaltstack(unsigned long bx)

return do_sigaltstack(uss, uoss, regs->sp);
}
#else /* !CONFIG_X86_32 */
asmlinkage long
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
struct pt_regs *regs)
{
return do_sigaltstack(uss, uoss, regs->sp);
}
#endif /* CONFIG_X86_32 */

#define COPY(x) { \
err |= __get_user(regs->x, &sc->x); \
Expand Down
15 changes: 15 additions & 0 deletions arch/x86/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,27 @@
# define FIX_EFLAGS __FIX_EFLAGS
#endif

#ifdef CONFIG_X86_32
asmlinkage int sys_sigaltstack(unsigned long bx)
{
/*
* This is needed to make gcc realize it doesn't own the
* "struct pt_regs"
*/
struct pt_regs *regs = (struct pt_regs *)&bx;
const stack_t __user *uss = (const stack_t __user *)bx;
stack_t __user *uoss = (stack_t __user *)regs->cx;

return do_sigaltstack(uss, uoss, regs->sp);
}
#else /* !CONFIG_X86_32 */
asmlinkage long
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
struct pt_regs *regs)
{
return do_sigaltstack(uss, uoss, regs->sp);
}
#endif /* CONFIG_X86_32 */

#define COPY(x) { \
err |= __get_user(regs->x, &sc->x); \
Expand Down

0 comments on commit 666ac7b

Please sign in to comment.