Skip to content

Commit

Permalink
s390: switch to generic compat rt_sigaction
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 d7b5427 commit f036b94
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 49 deletions.
1 change: 1 addition & 0 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ config S390
select MODULES_USE_ELF_RELA
select CLONE_BACKWARDS2
select GENERIC_SIGALTSTACK
select GENERIC_COMPAT_RT_SIGACTION
select GENERIC_COMPAT_RT_SIGQUEUEINFO
select GENERIC_COMPAT_RT_SIGPROCMASK
select GENERIC_COMPAT_RT_SIGPENDING
Expand Down
8 changes: 0 additions & 8 deletions arch/s390/kernel/compat_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ struct sigcontext32
};

/* asm/signal.h */
struct sigaction32 {
__u32 sa_handler; /* pointer */
__u32 sa_flags;
__u32 sa_restorer; /* pointer */
compat_sigset_t sa_mask; /* mask last for extensibility */
};

/* asm/ucontext.h */
struct ucontext32 {
Expand Down Expand Up @@ -139,6 +133,4 @@ long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise);
long sys32_fadvise64_64(struct fadvise64_64_args __user *args);
long sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
struct old_sigaction32 __user *oact);
long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
struct sigaction32 __user *oact, size_t sigsetsize);
#endif /* _ASM_S390X_S390_H */
40 changes: 0 additions & 40 deletions arch/s390/kernel/compat_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,46 +194,6 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
return ret;
}

asmlinkage long
sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
struct sigaction32 __user *oact, size_t sigsetsize)
{
struct k_sigaction new_ka, old_ka;
unsigned long sa_handler;
int ret;
compat_sigset_t set32;

/* XXX: Don't preclude handling different sized sigset_t's. */
if (sigsetsize != sizeof(compat_sigset_t))
return -EINVAL;

if (act) {
ret = get_user(sa_handler, &act->sa_handler);
ret |= __copy_from_user(&set32, &act->sa_mask,
sizeof(compat_sigset_t));
new_ka.sa.sa_mask.sig[0] =
set32.sig[0] | (((long)set32.sig[1]) << 32);
ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);

if (ret)
return -EFAULT;
new_ka.sa.sa_handler = (__sighandler_t) sa_handler;
}

ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);

if (!ret && oact) {
set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32);
set32.sig[0] = old_ka.sa.sa_mask.sig[0];
ret = put_user((unsigned long)old_ka.sa.sa_handler, &oact->sa_handler);
ret |= __copy_to_user(&oact->sa_mask, &set32,
sizeof(compat_sigset_t));
ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
}

return ret;
}

static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs)
{
_s390_regs_common32 regs32;
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/compat_wrapper.S
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ ENTRY(sys32_rt_sigaction_wrapper)
llgtr %r3,%r3 # const struct sigaction_emu31 *
llgtr %r4,%r4 # const struct sigaction_emu31 *
llgfr %r5,%r5 # size_t
jg sys32_rt_sigaction # branch to system call
jg compat_sys_rt_sigaction # branch to system call

ENTRY(sys32_rt_sigprocmask_wrapper)
lgfr %r2,%r2 # int
Expand Down

0 comments on commit f036b94

Please sign in to comment.