mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
Merge branches 'arch-alpha', 'arch-arm', 'arch-arm64', 'arch-avr32', 'arch-blackfin', 'arch-c6x', 'arch-cris', 'arch-frv', 'arch-h8300', 'arch-hexagon', 'arch-ia64', 'arch-m32r', 'arch-m68k', 'arch-microblaze', 'arch-mips', 'arch-mn10300', 'arch-openrisc', 'arch-parisc', 'arch-powerpc', 'arch-s390', 'arch-score', 'arch-sh', 'arch-sparc', 'arch-tile', 'arch-unicore32', 'arch-x86' and 'arch-xtensa'
This commit is contained in:
parent
302627e9f9
50bcb7e473
51682036d0
4788069501
79d432103c
6ec78be4cd
e6a6d210e0
177b6703f6
b0375744f1
da36f98a52
e8d9ef09df
1084f751d4
8be433ab55
de2bfce30e
50150d2bb9
33f9f78eec
faec5a96a0
b0f95824f2
b1ff98cb74
1cb44eb837
b774cc5cb6
0679a858c5
52ad6b3f90
a402922bff
50b3c9e30a
5b3eb3ade4
0430f2f276
commit
9b25d60418
@ -56,6 +56,9 @@ config ARM
|
||||
select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
|
||||
select MODULES_USE_ELF_REL
|
||||
select CLONE_BACKWARDS
|
||||
select GENERIC_SIGALTSTACK
|
||||
select OLD_SIGSUSPEND3
|
||||
select OLD_SIGACTION
|
||||
help
|
||||
The ARM series is a line of low-power-consumption RISC chip designs
|
||||
licensed by ARM Ltd and targeted at embedded applications and
|
||||
|
@ -16,13 +16,6 @@ typedef struct {
|
||||
unsigned long sig[_NSIG_WORDS];
|
||||
} sigset_t;
|
||||
|
||||
struct old_sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
old_sigset_t sa_mask;
|
||||
unsigned long sa_flags;
|
||||
__sigrestore_t sa_restorer;
|
||||
};
|
||||
|
||||
#define __ARCH_HAS_SA_RESTORER
|
||||
|
||||
#include <asm/sigcontext.h>
|
||||
|
@ -195,7 +195,7 @@
|
||||
CALL(sys_getcwd)
|
||||
CALL(sys_capget)
|
||||
/* 185 */ CALL(sys_capset)
|
||||
CALL(sys_sigaltstack_wrapper)
|
||||
CALL(sys_sigaltstack)
|
||||
CALL(sys_sendfile)
|
||||
CALL(sys_ni_syscall) /* getpmsg */
|
||||
CALL(sys_ni_syscall) /* putpmsg */
|
||||
|
@ -514,11 +514,6 @@ sys_rt_sigreturn_wrapper:
|
||||
b sys_rt_sigreturn
|
||||
ENDPROC(sys_rt_sigreturn_wrapper)
|
||||
|
||||
sys_sigaltstack_wrapper:
|
||||
ldr r2, [sp, #S_OFF + S_SP]
|
||||
b do_sigaltstack
|
||||
ENDPROC(sys_sigaltstack_wrapper)
|
||||
|
||||
sys_statfs64_wrapper:
|
||||
teq r1, #88
|
||||
moveq r1, #84
|
||||
|
@ -45,48 +45,6 @@ const unsigned long sigreturn_codes[7] = {
|
||||
MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN,
|
||||
};
|
||||
|
||||
/*
|
||||
* atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
asmlinkage int
|
||||
sys_sigaction(int sig, const struct old_sigaction __user *act,
|
||||
struct old_sigaction __user *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
if (act) {
|
||||
old_sigset_t mask;
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
|
||||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CRUNCH
|
||||
static int preserve_crunch_context(struct crunch_sigframe __user *frame)
|
||||
{
|
||||
@ -300,7 +258,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
|
||||
if (restore_sigframe(regs, &frame->sig))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT)
|
||||
if (restore_altstack(&frame->sig.uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return regs->ARM_r0;
|
||||
@ -486,7 +444,6 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
|
||||
sigset_t *set, struct pt_regs *regs)
|
||||
{
|
||||
struct rt_sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame));
|
||||
stack_t stack;
|
||||
int err = 0;
|
||||
|
||||
if (!frame)
|
||||
@ -497,12 +454,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
|
||||
__put_user_error(0, &frame->sig.uc.uc_flags, err);
|
||||
__put_user_error(NULL, &frame->sig.uc.uc_link, err);
|
||||
|
||||
memset(&stack, 0, sizeof(stack));
|
||||
stack.ss_sp = (void __user *)current->sas_ss_sp;
|
||||
stack.ss_flags = sas_ss_flags(regs->ARM_sp);
|
||||
stack.ss_size = current->sas_ss_size;
|
||||
err |= __copy_to_user(&frame->sig.uc.uc_stack, &stack, sizeof(stack));
|
||||
|
||||
err |= __save_altstack(&frame->sig.uc.uc_stack, regs->ARM_sp);
|
||||
err |= setup_sigframe(&frame->sig, regs, set);
|
||||
if (err == 0)
|
||||
err = setup_return(regs, ka, frame->sig.retcode, frame, usig);
|
||||
|
@ -6,10 +6,15 @@ config ARM64
|
||||
select CLONE_BACKWARDS
|
||||
select COMMON_CLK
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select GENERIC_COMPAT_RT_SIGACTION
|
||||
select GENERIC_COMPAT_RT_SIGPENDING
|
||||
select GENERIC_COMPAT_RT_SIGPROCMASK
|
||||
select GENERIC_COMPAT_RT_SIGQUEUEINFO
|
||||
select GENERIC_HARDIRQS_NO_DEPRECATED
|
||||
select GENERIC_IOMAP
|
||||
select GENERIC_IRQ_PROBE
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_SIGALTSTACK
|
||||
select GENERIC_SMP_IDLE_THREAD
|
||||
select GENERIC_TIME_VSYSCALL
|
||||
select HARDIRQS_SW_RESEND
|
||||
@ -204,6 +209,8 @@ config COMPAT
|
||||
depends on !ARM64_64K_PAGES
|
||||
select COMPAT_BINFMT_ELF
|
||||
select HAVE_UID16
|
||||
select OLD_SIGSUSPEND3
|
||||
select COMPAT_OLD_SIGACTION
|
||||
help
|
||||
This option enables support for a 32-bit EL0 running under a 64-bit
|
||||
kernel at EL1. AArch32-specific components such as system calls,
|
||||
|
@ -24,8 +24,6 @@
|
||||
* System call wrappers implemented in kernel/entry.S.
|
||||
*/
|
||||
asmlinkage long sys_rt_sigreturn_wrapper(void);
|
||||
asmlinkage long sys_sigaltstack_wrapper(const stack_t __user *uss,
|
||||
stack_t __user *uoss);
|
||||
|
||||
#include <asm-generic/syscalls.h>
|
||||
|
||||
|
@ -93,7 +93,7 @@ __SYSCALL(68, sys_ni_syscall) /* 68 was sys_sgetmask */
|
||||
__SYSCALL(69, sys_ni_syscall) /* 69 was sys_ssetmask */
|
||||
__SYSCALL(70, sys_setreuid16)
|
||||
__SYSCALL(71, sys_setregid16)
|
||||
__SYSCALL(72, compat_sys_sigsuspend)
|
||||
__SYSCALL(72, sys_sigsuspend)
|
||||
__SYSCALL(73, compat_sys_sigpending)
|
||||
__SYSCALL(74, sys_sethostname)
|
||||
__SYSCALL(75, compat_sys_setrlimit)
|
||||
@ -207,7 +207,7 @@ __SYSCALL(182, sys_chown16)
|
||||
__SYSCALL(183, sys_getcwd)
|
||||
__SYSCALL(184, sys_capget)
|
||||
__SYSCALL(185, sys_capset)
|
||||
__SYSCALL(186, compat_sys_sigaltstack_wrapper)
|
||||
__SYSCALL(186, compat_sys_sigaltstack)
|
||||
__SYSCALL(187, compat_sys_sendfile)
|
||||
__SYSCALL(188, sys_ni_syscall) /* 188 reserved */
|
||||
__SYSCALL(189, sys_ni_syscall) /* 189 reserved */
|
||||
|
@ -677,10 +677,5 @@ ENTRY(sys_rt_sigreturn_wrapper)
|
||||
b sys_rt_sigreturn
|
||||
ENDPROC(sys_rt_sigreturn_wrapper)
|
||||
|
||||
ENTRY(sys_sigaltstack_wrapper)
|
||||
ldr x2, [sp, #S_SP]
|
||||
b sys_sigaltstack
|
||||
ENDPROC(sys_sigaltstack_wrapper)
|
||||
|
||||
ENTRY(handle_arch_irq)
|
||||
.quad 0
|
||||
|
@ -149,8 +149,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
|
||||
if (restore_sigframe(regs, frame))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->uc.uc_stack,
|
||||
NULL, regs->sp) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return regs->regs[0];
|
||||
@ -164,12 +163,6 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
|
||||
unsigned long sp)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, sp);
|
||||
}
|
||||
|
||||
static int setup_sigframe(struct rt_sigframe __user *sf,
|
||||
struct pt_regs *regs, sigset_t *set)
|
||||
{
|
||||
@ -250,7 +243,6 @@ static int setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
|
||||
sigset_t *set, struct pt_regs *regs)
|
||||
{
|
||||
struct rt_sigframe __user *frame;
|
||||
stack_t stack;
|
||||
int err = 0;
|
||||
|
||||
frame = get_sigframe(ka, regs);
|
||||
@ -260,12 +252,7 @@ static int setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
|
||||
__put_user_error(0, &frame->uc.uc_flags, err);
|
||||
__put_user_error(NULL, &frame->uc.uc_link, err);
|
||||
|
||||
memset(&stack, 0, sizeof(stack));
|
||||
stack.ss_sp = (void __user *)current->sas_ss_sp;
|
||||
stack.ss_flags = sas_ss_flags(regs->sp);
|
||||
stack.ss_size = current->sas_ss_size;
|
||||
err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack));
|
||||
|
||||
err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
|
||||
err |= setup_sigframe(frame, regs, set);
|
||||
if (err == 0) {
|
||||
setup_return(regs, ka, frame, usig);
|
||||
|
@ -28,26 +28,6 @@
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/unistd32.h>
|
||||
|
||||
struct compat_sigaction {
|
||||
compat_uptr_t sa_handler;
|
||||
compat_ulong_t sa_flags;
|
||||
compat_uptr_t sa_restorer;
|
||||
compat_sigset_t sa_mask;
|
||||
};
|
||||
|
||||
struct compat_old_sigaction {
|
||||
compat_uptr_t sa_handler;
|
||||
compat_old_sigset_t sa_mask;
|
||||
compat_ulong_t sa_flags;
|
||||
compat_uptr_t sa_restorer;
|
||||
};
|
||||
|
||||
typedef struct compat_sigaltstack {
|
||||
compat_uptr_t ss_sp;
|
||||
int ss_flags;
|
||||
compat_size_t ss_size;
|
||||
} compat_stack_t;
|
||||
|
||||
struct compat_sigcontext {
|
||||
/* We always set these two fields to 0 */
|
||||
compat_ulong_t trap_no;
|
||||
@ -339,127 +319,6 @@ static int compat_restore_vfp_context(struct compat_vfp_sigframe __user *frame)
|
||||
return err ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
asmlinkage int compat_sys_sigsuspend(int restart, compat_ulong_t oldmask,
|
||||
compat_old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
|
||||
siginitset(¤t->blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
asmlinkage int compat_sys_sigaction(int sig,
|
||||
const struct compat_old_sigaction __user *act,
|
||||
struct compat_old_sigaction __user *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
compat_old_sigset_t mask;
|
||||
compat_uptr_t handler, restorer;
|
||||
|
||||
if (act) {
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(handler, &act->sa_handler) ||
|
||||
__get_user(restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
|
||||
new_ka.sa.sa_handler = compat_ptr(handler);
|
||||
new_ka.sa.sa_restorer = compat_ptr(restorer);
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(ptr_to_compat(old_ka.sa.sa_handler),
|
||||
&oact->sa_handler) ||
|
||||
__put_user(ptr_to_compat(old_ka.sa.sa_restorer),
|
||||
&oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage int compat_sys_rt_sigaction(int sig,
|
||||
const struct compat_sigaction __user *act,
|
||||
struct compat_sigaction __user *oact,
|
||||
compat_size_t sigsetsize)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
/* XXX: Don't preclude handling different sized sigset_t's. */
|
||||
if (sigsetsize != sizeof(compat_sigset_t))
|
||||
return -EINVAL;
|
||||
|
||||
if (act) {
|
||||
compat_uptr_t handler, restorer;
|
||||
|
||||
ret = get_user(handler, &act->sa_handler);
|
||||
new_ka.sa.sa_handler = compat_ptr(handler);
|
||||
ret |= get_user(restorer, &act->sa_restorer);
|
||||
new_ka.sa.sa_restorer = compat_ptr(restorer);
|
||||
ret |= get_sigset_t(&new_ka.sa.sa_mask, &act->sa_mask);
|
||||
ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
|
||||
if (ret)
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
if (!ret && oact) {
|
||||
ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler);
|
||||
ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask);
|
||||
ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int compat_do_sigaltstack(compat_uptr_t compat_uss, compat_uptr_t compat_uoss,
|
||||
compat_ulong_t sp)
|
||||
{
|
||||
compat_stack_t __user *newstack = compat_ptr(compat_uss);
|
||||
compat_stack_t __user *oldstack = compat_ptr(compat_uoss);
|
||||
compat_uptr_t ss_sp;
|
||||
int ret;
|
||||
mm_segment_t old_fs;
|
||||
stack_t uss, uoss;
|
||||
|
||||
/* Marshall the compat new stack into a stack_t */
|
||||
if (newstack) {
|
||||
if (get_user(ss_sp, &newstack->ss_sp) ||
|
||||
__get_user(uss.ss_flags, &newstack->ss_flags) ||
|
||||
__get_user(uss.ss_size, &newstack->ss_size))
|
||||
return -EFAULT;
|
||||
uss.ss_sp = compat_ptr(ss_sp);
|
||||
}
|
||||
|
||||
old_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
/* The __user pointer casts are valid because of the set_fs() */
|
||||
ret = do_sigaltstack(
|
||||
newstack ? (stack_t __user *) &uss : NULL,
|
||||
oldstack ? (stack_t __user *) &uoss : NULL,
|
||||
(unsigned long)sp);
|
||||
set_fs(old_fs);
|
||||
|
||||
/* Convert the old stack_t into a compat stack. */
|
||||
if (!ret && oldstack &&
|
||||
(put_user(ptr_to_compat(uoss.ss_sp), &oldstack->ss_sp) ||
|
||||
__put_user(uoss.ss_flags, &oldstack->ss_flags) ||
|
||||
__put_user(uoss.ss_size, &oldstack->ss_size)))
|
||||
return -EFAULT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int compat_restore_sigframe(struct pt_regs *regs,
|
||||
struct compat_sigframe __user *sf)
|
||||
{
|
||||
@ -562,9 +421,7 @@ asmlinkage int compat_sys_rt_sigreturn(struct pt_regs *regs)
|
||||
if (compat_restore_sigframe(regs, &frame->sig))
|
||||
goto badframe;
|
||||
|
||||
if (compat_do_sigaltstack(ptr_to_compat(&frame->sig.uc.uc_stack),
|
||||
ptr_to_compat((void __user *)NULL),
|
||||
regs->compat_sp) == -EFAULT)
|
||||
if (compat_restore_altstack(&frame->sig.uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return regs->regs[0];
|
||||
@ -705,11 +562,7 @@ int compat_setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
|
||||
__put_user_error(0, &frame->sig.uc.uc_flags, err);
|
||||
__put_user_error(NULL, &frame->sig.uc.uc_link, err);
|
||||
|
||||
memset(&stack, 0, sizeof(stack));
|
||||
stack.ss_sp = (compat_uptr_t)current->sas_ss_sp;
|
||||
stack.ss_flags = sas_ss_flags(regs->compat_sp);
|
||||
stack.ss_size = current->sas_ss_size;
|
||||
err |= __copy_to_user(&frame->sig.uc.uc_stack, &stack, sizeof(stack));
|
||||
err |= __compat_save_altstack(&frame->sig.uc.uc_stack, regs->compat_sp);
|
||||
|
||||
err |= compat_setup_sigframe(&frame->sig, regs, set);
|
||||
|
||||
@ -742,75 +595,6 @@ int compat_setup_frame(int usig, struct k_sigaction *ka, sigset_t *set,
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* RT signals don't have generic compat wrappers.
|
||||
* See arch/powerpc/kernel/signal_32.c
|
||||
*/
|
||||
asmlinkage int compat_sys_rt_sigprocmask(int how, compat_sigset_t __user *set,
|
||||
compat_sigset_t __user *oset,
|
||||
compat_size_t sigsetsize)
|
||||
{
|
||||
sigset_t s;
|
||||
sigset_t __user *up;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
if (set) {
|
||||
if (get_sigset_t(&s, set))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
/* This is valid because of the set_fs() */
|
||||
up = (sigset_t __user *) &s;
|
||||
ret = sys_rt_sigprocmask(how, set ? up : NULL, oset ? up : NULL,
|
||||
sigsetsize);
|
||||
set_fs(old_fs);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (oset) {
|
||||
if (put_sigset_t(oset, &s))
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
asmlinkage int compat_sys_rt_sigpending(compat_sigset_t __user *set,
|
||||
compat_size_t sigsetsize)
|
||||
{
|
||||
sigset_t s;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
/* The __user pointer cast is valid because of the set_fs() */
|
||||
ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize);
|
||||
set_fs(old_fs);
|
||||
if (!ret) {
|
||||
if (put_sigset_t(set, &s))
|
||||
return -EFAULT;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage int compat_sys_rt_sigqueueinfo(int pid, int sig,
|
||||
compat_siginfo_t __user *uinfo)
|
||||
{
|
||||
siginfo_t info;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
ret = copy_siginfo_from_user32(&info, uinfo);
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
|
||||
set_fs (KERNEL_DS);
|
||||
/* The __user pointer cast is valid because of the set_fs() */
|
||||
ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *) &info);
|
||||
set_fs (old_fs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void compat_setup_restart_syscall(struct pt_regs *regs)
|
||||
{
|
||||
regs->regs[7] = __NR_compat_restart_syscall;
|
||||
|
@ -40,7 +40,6 @@ asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
|
||||
* Wrappers to pass the pt_regs argument.
|
||||
*/
|
||||
#define sys_rt_sigreturn sys_rt_sigreturn_wrapper
|
||||
#define sys_sigaltstack sys_sigaltstack_wrapper
|
||||
|
||||
#include <asm/syscalls.h>
|
||||
|
||||
|
@ -39,11 +39,6 @@ compat_sys_rt_sigreturn_wrapper:
|
||||
b compat_sys_rt_sigreturn
|
||||
ENDPROC(compat_sys_rt_sigreturn_wrapper)
|
||||
|
||||
compat_sys_sigaltstack_wrapper:
|
||||
ldr x2, [sp, #S_COMPAT_SP]
|
||||
b compat_do_sigaltstack
|
||||
ENDPROC(compat_sys_sigaltstack_wrapper)
|
||||
|
||||
compat_sys_statfs64_wrapper:
|
||||
mov w3, #84
|
||||
cmp w1, #88
|
||||
|
@ -17,6 +17,7 @@ config AVR32
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
help
|
||||
AVR32 is a high-performance 32-bit RISC microprocessor core,
|
||||
designed for cost-sensitive embedded applications, with particular
|
||||
|
@ -21,12 +21,6 @@
|
||||
#include <asm/ucontext.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 siginfo info;
|
||||
@ -91,7 +85,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
|
||||
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
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 */
|
||||
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->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->sp);
|
||||
err |= setup_sigcontext(&frame->uc.uc_mcontext, regs);
|
||||
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
|
||||
|
@ -20,12 +20,6 @@ __sys_rt_sigsuspend:
|
||||
mov r10, sp
|
||||
rjmp sys_rt_sigsuspend
|
||||
|
||||
.global __sys_sigaltstack
|
||||
.type __sys_sigaltstack,@function
|
||||
__sys_sigaltstack:
|
||||
mov r10, sp
|
||||
rjmp sys_sigaltstack
|
||||
|
||||
.global __sys_rt_sigreturn
|
||||
.type __sys_rt_sigreturn,@function
|
||||
__sys_rt_sigreturn:
|
||||
|
@ -115,7 +115,7 @@ sys_call_table:
|
||||
.long sys_statfs
|
||||
.long sys_fstatfs /* 100 */
|
||||
.long sys_vhangup
|
||||
.long __sys_sigaltstack
|
||||
.long sys_sigaltstack
|
||||
.long sys_syslog
|
||||
.long sys_setitimer
|
||||
.long sys_getitimer /* 105 */
|
||||
|
@ -45,6 +45,7 @@ config BLACKFIN
|
||||
select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
|
||||
config GENERIC_CSUM
|
||||
def_bool y
|
||||
|
@ -37,11 +37,6 @@ struct rt_sigframe {
|
||||
struct ucontext uc;
|
||||
};
|
||||
|
||||
asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, rdusp());
|
||||
}
|
||||
|
||||
static inline int
|
||||
rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *pr0)
|
||||
{
|
||||
@ -100,7 +95,7 @@ asmlinkage int sys_rt_sigreturn(void)
|
||||
if (rt_restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->usp) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return r0;
|
||||
@ -178,10 +173,7 @@ 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(rdusp()), &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, rdusp());
|
||||
err |= rt_setup_sigcontext(&frame->uc.uc_mcontext, regs);
|
||||
err |= copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
|
||||
|
@ -18,6 +18,7 @@ config C6X
|
||||
select OF_EARLY_FLATTREE
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
|
||||
config MMU
|
||||
def_bool n
|
||||
|
@ -598,18 +598,6 @@ ENTRY(enable_exception)
|
||||
NOP 5
|
||||
ENDPROC(enable_exception)
|
||||
|
||||
ENTRY(sys_sigaltstack)
|
||||
#ifdef CONFIG_C6X_BIG_KERNEL
|
||||
MVKL .S1 do_sigaltstack,A0 ; branch to do_sigaltstack
|
||||
MVKH .S1 do_sigaltstack,A0
|
||||
B .S2X A0
|
||||
#else
|
||||
B .S2 do_sigaltstack
|
||||
#endif
|
||||
LDW .D2T1 *+SP(REGS_SP+8),A6
|
||||
NOP 4
|
||||
ENDPROC(sys_sigaltstack)
|
||||
|
||||
;;
|
||||
;; Special system calls
|
||||
;; return address is in B3
|
||||
|
@ -50,6 +50,9 @@ config CRIS
|
||||
select GENERIC_CMOS_UPDATE
|
||||
select MODULES_USE_ELF_RELA
|
||||
select CLONE_BACKWARDS2
|
||||
select GENERIC_SIGALTSTACK
|
||||
select OLD_SIGSUSPEND
|
||||
select OLD_SIGACTION
|
||||
|
||||
config HZ
|
||||
int
|
||||
|
@ -41,55 +41,6 @@
|
||||
|
||||
void do_signal(int canrestart, struct pt_regs *regs);
|
||||
|
||||
/*
|
||||
* Atomically swap in the new signal mask, and wait for a signal. Define
|
||||
* dummy arguments to be able to reach the regs argument. (Note that this
|
||||
* arrangement relies on old_sigset_t occupying one register.)
|
||||
*/
|
||||
int sys_sigsuspend(old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
int sys_sigaction(int sig, const struct old_sigaction __user *act,
|
||||
struct old_sigaction *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
if (act) {
|
||||
old_sigset_t mask;
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
|
||||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int sys_sigaltstack(const stack_t *uss, stack_t __user *uoss)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, rdusp());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Do a signal return; undo the signal stack.
|
||||
*/
|
||||
@ -150,11 +101,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Define dummy arguments to be able to reach the regs argument. */
|
||||
|
||||
asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
|
||||
long srp, struct pt_regs *regs)
|
||||
asmlinkage int sys_sigreturn(void)
|
||||
{
|
||||
struct pt_regs *regs = current_pt_regs();
|
||||
struct sigframe __user *frame = (struct sigframe *)rdusp();
|
||||
sigset_t set;
|
||||
|
||||
@ -188,11 +137,9 @@ asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Define dummy arguments to be able to reach the regs argument. */
|
||||
|
||||
asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
|
||||
long mof, long srp, struct pt_regs *regs)
|
||||
asmlinkage int sys_rt_sigreturn(void)
|
||||
{
|
||||
struct pt_regs *regs = current_pt_regs();
|
||||
struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp();
|
||||
sigset_t set;
|
||||
|
||||
@ -214,7 +161,7 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
|
||||
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return regs->r10;
|
||||
@ -362,6 +309,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
||||
|
||||
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
|
||||
err |= __save_altstack(&frame->uc.uc_stack, rdusp());
|
||||
|
||||
if (err)
|
||||
goto give_sigsegv;
|
||||
|
||||
|
@ -51,59 +51,6 @@ struct rt_signal_frame {
|
||||
void do_signal(int restart, struct pt_regs *regs);
|
||||
void keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
|
||||
struct pt_regs *regs);
|
||||
/*
|
||||
* Swap in the new signal mask, and wait for a signal. Define some
|
||||
* dummy arguments to be able to reach the regs argument.
|
||||
*/
|
||||
int
|
||||
sys_sigsuspend(old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
int
|
||||
sys_sigaction(int signal, const struct old_sigaction *act,
|
||||
struct old_sigaction *oact)
|
||||
{
|
||||
int retval;
|
||||
struct k_sigaction newk;
|
||||
struct k_sigaction oldk;
|
||||
|
||||
if (act) {
|
||||
old_sigset_t mask;
|
||||
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(newk.sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(newk.sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(newk.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
|
||||
siginitset(&newk.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
retval = do_sigaction(signal, act ? &newk : NULL, oact ? &oldk : NULL);
|
||||
|
||||
if (!retval && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(oldk.sa.sa_handler, &oact->sa_handler) ||
|
||||
__put_user(oldk.sa.sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(oldk.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(oldk.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int
|
||||
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, rdusp());
|
||||
}
|
||||
|
||||
static int
|
||||
restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
|
||||
@ -135,11 +82,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Define some dummy arguments to be able to reach the regs argument. */
|
||||
asmlinkage int
|
||||
sys_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
|
||||
struct pt_regs *regs)
|
||||
asmlinkage int sys_sigreturn(void)
|
||||
{
|
||||
struct pt_regs *regs = current_pt_regs();
|
||||
sigset_t set;
|
||||
struct signal_frame __user *frame;
|
||||
unsigned long oldspc = regs->spc;
|
||||
@ -178,11 +123,9 @@ sys_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Define some dummy variables to be able to reach the regs argument. */
|
||||
asmlinkage int
|
||||
sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
|
||||
struct pt_regs *regs)
|
||||
asmlinkage int sys_rt_sigreturn(void)
|
||||
{
|
||||
struct pt_regs *regs = current_pt_regs();
|
||||
sigset_t set;
|
||||
struct rt_signal_frame __user *frame;
|
||||
unsigned long oldspc = regs->spc;
|
||||
@ -209,7 +152,7 @@ sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
|
||||
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
keep_debug_flags(oldccs, oldspc, regs);
|
||||
@ -371,6 +314,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
||||
err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));
|
||||
err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
|
||||
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
err |= __save_altstack(&frame->uc.uc_stack, rdusp());
|
||||
|
||||
if (err)
|
||||
goto give_sigsegv;
|
||||
|
@ -16,13 +16,6 @@ typedef struct {
|
||||
unsigned long sig[_NSIG_WORDS];
|
||||
} sigset_t;
|
||||
|
||||
struct old_sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
old_sigset_t sa_mask;
|
||||
unsigned long sa_flags;
|
||||
void (*sa_restorer)(void);
|
||||
};
|
||||
|
||||
#define __ARCH_HAS_SA_RESTORER
|
||||
|
||||
#include <asm/sigcontext.h>
|
||||
|
@ -12,6 +12,9 @@ config FRV
|
||||
select ARCH_HAVE_NMI_SAFE_CMPXCHG
|
||||
select GENERIC_CPU_DEVICES
|
||||
select ARCH_WANT_IPC_PARSE_VERSION
|
||||
select GENERIC_SIGALTSTACK
|
||||
select OLD_SIGSUSPEND3
|
||||
select OLD_SIGACTION
|
||||
|
||||
config ZONE_DMA
|
||||
bool
|
||||
|
@ -3,11 +3,4 @@
|
||||
|
||||
#include <uapi/asm/signal.h>
|
||||
|
||||
struct old_sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
old_sigset_t sa_mask;
|
||||
unsigned long sa_flags;
|
||||
__sigrestore_t sa_restorer;
|
||||
};
|
||||
|
||||
#endif /* _ASM_SIGNAL_H */
|
||||
|
@ -32,55 +32,6 @@ struct fdpic_func_descriptor {
|
||||
unsigned long GOT;
|
||||
};
|
||||
|
||||
/*
|
||||
* Atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
asmlinkage int sys_sigsuspend(int history0, int history1, old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
asmlinkage int sys_sigaction(int sig,
|
||||
const struct old_sigaction __user *act,
|
||||
struct old_sigaction __user *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
if (act) {
|
||||
old_sigset_t mask;
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
|
||||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage
|
||||
int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, __frame->sp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Do a signal return; undo the signal stack.
|
||||
*/
|
||||
@ -173,7 +124,7 @@ asmlinkage int sys_rt_sigreturn(void)
|
||||
if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, __frame->sp) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return gr8;
|
||||
@ -345,9 +296,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
||||
/* Create the ucontext. */
|
||||
if (__put_user(0, &frame->uc.uc_flags) ||
|
||||
__put_user(NULL, &frame->uc.uc_link) ||
|
||||
__put_user((void __user *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) ||
|
||||
__put_user(sas_ss_flags(__frame->sp), &frame->uc.uc_stack.ss_flags) ||
|
||||
__put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size))
|
||||
__save_altstack(&frame->uc.uc_stack, __frame->sp))
|
||||
goto give_sigsegv;
|
||||
|
||||
if (setup_sigcontext(&frame->uc.uc_mcontext, set->sig[0]))
|
||||
|
@ -9,6 +9,9 @@ config H8300
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_CPU_DEVICES
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
select OLD_SIGSUSPEND3
|
||||
select OLD_SIGACTION
|
||||
|
||||
config SYMBOL_PREFIX
|
||||
string
|
||||
|
@ -16,13 +16,6 @@ typedef struct {
|
||||
unsigned long sig[_NSIG_WORDS];
|
||||
} sigset_t;
|
||||
|
||||
struct old_sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
old_sigset_t sa_mask;
|
||||
unsigned long sa_flags;
|
||||
void (*sa_restorer)(void);
|
||||
};
|
||||
|
||||
#define __ARCH_HAS_SA_RESTORER
|
||||
|
||||
#include <asm/sigcontext.h>
|
||||
|
@ -46,56 +46,6 @@
|
||||
#include <asm/traps.h>
|
||||
#include <asm/ucontext.h>
|
||||
|
||||
/*
|
||||
* Atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
asmlinkage int
|
||||
sys_sigsuspend(int unused1, int unused2, old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
asmlinkage int
|
||||
sys_sigaction(int sig, const struct old_sigaction *act,
|
||||
struct old_sigaction *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
if (act) {
|
||||
old_sigset_t mask;
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
|
||||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage int
|
||||
sys_sigaltstack(const stack_t *uss, stack_t *uoss)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, rdusp());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Do a signal return; undo the signal stack.
|
||||
*
|
||||
@ -136,9 +86,9 @@ struct rt_sigframe
|
||||
} __attribute__((aligned(2),packed));
|
||||
|
||||
static inline int
|
||||
restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc,
|
||||
int *pd0)
|
||||
restore_sigcontext(struct sigcontext *usc, int *pd0)
|
||||
{
|
||||
struct pt_regs *regs = current_pt_regs();
|
||||
int err = 0;
|
||||
unsigned int ccr;
|
||||
unsigned int usp;
|
||||
@ -167,9 +117,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc,
|
||||
return err;
|
||||
}
|
||||
|
||||
asmlinkage int do_sigreturn(unsigned long __unused,...)
|
||||
asmlinkage int sys_sigreturn(void)
|
||||
{
|
||||
struct pt_regs *regs = (struct pt_regs *) (&__unused - 1);
|
||||
unsigned long usp = rdusp();
|
||||
struct sigframe *frame = (struct sigframe *)(usp - 4);
|
||||
sigset_t set;
|
||||
@ -185,7 +134,7 @@ asmlinkage int do_sigreturn(unsigned long __unused,...)
|
||||
|
||||
set_current_blocked(&set);
|
||||
|
||||
if (restore_sigcontext(regs, &frame->sc, &er0))
|
||||
if (restore_sigcontext(&frame->sc, &er0))
|
||||
goto badframe;
|
||||
return er0;
|
||||
|
||||
@ -194,9 +143,8 @@ asmlinkage int do_sigreturn(unsigned long __unused,...)
|
||||
return 0;
|
||||
}
|
||||
|
||||
asmlinkage int do_rt_sigreturn(unsigned long __unused,...)
|
||||
asmlinkage int sys_rt_sigreturn(void)
|
||||
{
|
||||
struct pt_regs *regs = (struct pt_regs *) &__unused;
|
||||
unsigned long usp = rdusp();
|
||||
struct rt_sigframe *frame = (struct rt_sigframe *)(usp - 4);
|
||||
sigset_t set;
|
||||
@ -209,10 +157,10 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused,...)
|
||||
|
||||
set_current_blocked(&set);
|
||||
|
||||
if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &er0))
|
||||
if (restore_sigcontext(&frame->uc.uc_mcontext, &er0))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, usp) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return er0;
|
||||
@ -358,11 +306,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(rdusp()),
|
||||
&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, rdusp());
|
||||
err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
|
||||
err |= copy_to_user (&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
if (err)
|
||||
|
@ -334,18 +334,3 @@ SYMBOL_NAME_LABEL(sys_call_table)
|
||||
.long SYMBOL_NAME(sys_getcpu)
|
||||
.long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_pwait */
|
||||
.long SYMBOL_NAME(sys_setns) /* 320 */
|
||||
|
||||
.macro call_sp addr
|
||||
mov.l #SYMBOL_NAME(\addr),er6
|
||||
bra SYMBOL_NAME(syscall_trampoline):8
|
||||
.endm
|
||||
|
||||
SYMBOL_NAME_LABEL(sys_sigreturn)
|
||||
call_sp do_sigreturn
|
||||
|
||||
SYMBOL_NAME_LABEL(sys_rt_sigreturn)
|
||||
call_sp do_rt_sigreturn
|
||||
|
||||
SYMBOL_NAME_LABEL(syscall_trampoline)
|
||||
mov.l sp,er0
|
||||
jmp @er6
|
||||
|
@ -31,6 +31,7 @@ config HEXAGON
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select GENERIC_CLOCKEVENTS_BROADCAST
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
---help---
|
||||
Qualcomm Hexagon is a processor architecture designed for high
|
||||
performance and low power across a wide variety of applications.
|
||||
|
@ -125,6 +125,7 @@ static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
|
||||
err |= __put_user(0x5400c004, &frame->tramp[1]);
|
||||
err |= setup_sigcontext(regs, &frame->uc.uc_mcontext);
|
||||
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
err |= __save_altstack(&frame->uc.uc_stack, user_stack_pointer(regs));
|
||||
if (err)
|
||||
goto sigsegv;
|
||||
|
||||
@ -247,12 +248,6 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
|
||||
/*
|
||||
* Architecture-specific wrappers for signal-related system calls
|
||||
*/
|
||||
asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
|
||||
{
|
||||
struct pt_regs *regs = current_pt_regs();
|
||||
|
||||
return do_sigaltstack(uss, uoss, regs->r29);
|
||||
}
|
||||
|
||||
asmlinkage int sys_rt_sigreturn(void)
|
||||
{
|
||||
@ -288,14 +283,7 @@ asmlinkage int sys_rt_sigreturn(void)
|
||||
*/
|
||||
regs->syscall_nr = __NR_rt_sigreturn;
|
||||
|
||||
/*
|
||||
* If we were meticulous, we'd only call this if we knew that
|
||||
* we were actually going to use an alternate stack, and we'd
|
||||
* consider any error to be fatal. What we do here, in common
|
||||
* with many other architectures, is call it blindly and only
|
||||
* consider the -EFAULT return case to be proof of a problem.
|
||||
*/
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, pt_psp(regs)) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return 0;
|
||||
|
@ -42,6 +42,7 @@ config IA64
|
||||
select GENERIC_TIME_VSYSCALL_OLD
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
default y
|
||||
help
|
||||
The Itanium Processor Family is Intel's 64-bit successor to
|
||||
|
@ -39,14 +39,6 @@
|
||||
# define GET_SIGSET(k,u) __get_user((k)->sig[0], &(u)->sig[0])
|
||||
#endif
|
||||
|
||||
asmlinkage long
|
||||
sys_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, long arg2,
|
||||
long arg3, long arg4, long arg5, long arg6, long arg7,
|
||||
struct pt_regs regs)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, regs.r12);
|
||||
}
|
||||
|
||||
static long
|
||||
restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
|
||||
{
|
||||
@ -208,11 +200,8 @@ ia64_rt_sigreturn (struct sigscratch *scr)
|
||||
printk("SIG return (%s:%d): sp=%lx ip=%lx\n",
|
||||
current->comm, current->pid, scr->pt.r12, scr->pt.cr_iip);
|
||||
#endif
|
||||
/*
|
||||
* It is more difficult to avoid calling this function than to
|
||||
* call it and ignore errors.
|
||||
*/
|
||||
do_sigaltstack(&sc->sc_stack, NULL, scr->pt.r12);
|
||||
if (restore_altstack(&sc->sc_stack))
|
||||
goto give_sigsegv;
|
||||
return retval;
|
||||
|
||||
give_sigsegv:
|
||||
@ -376,9 +365,7 @@ setup_frame (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set,
|
||||
|
||||
err |= copy_siginfo_to_user(&frame->info, info);
|
||||
|
||||
err |= __put_user(current->sas_ss_sp, &frame->sc.sc_stack.ss_sp);
|
||||
err |= __put_user(current->sas_ss_size, &frame->sc.sc_stack.ss_size);
|
||||
err |= __put_user(sas_ss_flags(scr->pt.r12), &frame->sc.sc_stack.ss_flags);
|
||||
err |= __save_altstack(&frame->sc.sc_stack, scr->pt.r12);
|
||||
err |= setup_sigcontext(&frame->sc, set, scr);
|
||||
|
||||
if (unlikely(err))
|
||||
|
@ -15,6 +15,7 @@ config M32R
|
||||
select GENERIC_ATOMIC64
|
||||
select ARCH_USES_GETTIMEOFFSET
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
|
||||
config SBUS
|
||||
bool
|
||||
|
@ -27,15 +27,6 @@
|
||||
|
||||
#define DEBUG_SIG 0
|
||||
|
||||
asmlinkage int
|
||||
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
|
||||
unsigned long r2, unsigned long r3, unsigned long r4,
|
||||
unsigned long r5, unsigned long r6, struct pt_regs *regs)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, regs->spu);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Do a signal return; undo the signal stack.
|
||||
*/
|
||||
@ -113,7 +104,7 @@ sys_rt_sigreturn(unsigned long r0, unsigned long r1,
|
||||
if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->spu) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return result;
|
||||
@ -213,10 +204,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(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
|
||||
err |= __put_user(sas_ss_flags(regs->spu),
|
||||
&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->spu);
|
||||
err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
|
||||
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
if (err)
|
||||
|
@ -18,6 +18,9 @@ config M68K
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select MODULES_USE_ELF_REL
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
select OLD_SIGSUSPEND3
|
||||
select OLD_SIGACTION
|
||||
|
||||
config RWSEM_GENERIC_SPINLOCK
|
||||
bool
|
||||
|
@ -16,13 +16,6 @@ typedef struct {
|
||||
unsigned long sig[_NSIG_WORDS];
|
||||
} sigset_t;
|
||||
|
||||
struct old_sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
old_sigset_t sa_mask;
|
||||
unsigned long sa_flags;
|
||||
__sigrestore_t sa_restorer;
|
||||
};
|
||||
|
||||
#define __ARCH_HAS_SA_RESTORER
|
||||
|
||||
#include <asm/sigcontext.h>
|
||||
|
@ -224,56 +224,6 @@ static inline void push_cache(unsigned long vaddr)
|
||||
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
/*
|
||||
* Atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
asmlinkage int
|
||||
sys_sigsuspend(int unused0, int unused1, old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
asmlinkage int
|
||||
sys_sigaction(int sig, const struct old_sigaction __user *act,
|
||||
struct old_sigaction __user *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
if (act) {
|
||||
old_sigset_t mask;
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
|
||||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage int
|
||||
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, rdusp());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Do a signal return; undo the signal stack.
|
||||
*
|
||||
@ -765,8 +715,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw,
|
||||
err |= __get_user(temp, &uc->uc_formatvec);
|
||||
|
||||
err |= rt_restore_fpu_state(uc);
|
||||
err |= restore_altstack(&uc->uc_stack);
|
||||
|
||||
if (err || do_sigaltstack(&uc->uc_stack, NULL, usp) == -EFAULT)
|
||||
if (err)
|
||||
goto badframe;
|
||||
|
||||
if (mangle_kernel_stack(regs, temp, &uc->uc_extra))
|
||||
@ -1014,11 +965,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(rdusp()),
|
||||
&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, rdusp());
|
||||
err |= rt_setup_ucontext(&frame->uc, regs);
|
||||
err |= copy_to_user (&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
|
||||
|
@ -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
|
||||
|
@ -124,6 +124,7 @@ ret_from_intr:
|
||||
lwi r11, r1, PT_MODE
|
||||
bneid r11, no_intr_resched
|
||||
|
||||
3:
|
||||
lwi r6, r31, TS_THREAD_INFO /* get thread info */
|
||||
lwi r19, r6, TI_FLAGS /* get flags in thread info */
|
||||
/* do an extra work if any bits are set */
|
||||
@ -132,11 +133,13 @@ ret_from_intr:
|
||||
beqi r11, 1f
|
||||
bralid r15, schedule
|
||||
nop
|
||||
bri 3b
|
||||
1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME
|
||||
beqid r11, no_intr_resched
|
||||
addk r5, r1, r0
|
||||
bralid r15, do_notify_resume
|
||||
addk r6, r0, r0
|
||||
bri 3b
|
||||
|
||||
no_intr_resched:
|
||||
/* Disable interrupts, we are now committed to the state restore */
|
||||
@ -280,6 +283,7 @@ ENTRY(_user_exception)
|
||||
/* Figure out which function to use for this system call. */
|
||||
/* Note Microblaze barrel shift is optional, so don't rely on it */
|
||||
add r12, r12, r12 /* convert num -> ptr */
|
||||
addik r30, r0, 1 /* restarts allowed */
|
||||
add r12, r12, r12
|
||||
lwi r12, r12, sys_call_table /* Get function pointer */
|
||||
addik r15, r0, ret_to_user-8 /* set return address */
|
||||
@ -369,6 +373,7 @@ ENTRY(_debug_exception)
|
||||
bralid r15, send_sig
|
||||
add r7, r0, r0 /* 3rd param zero */
|
||||
|
||||
addik r30, r0, 1 /* restarts allowed ??? */
|
||||
/* Restore r3/r4 to work around how ret_to_user works */
|
||||
lwi r3, r1, PT_R3
|
||||
lwi r4, r1, PT_R4
|
||||
@ -482,18 +487,26 @@ ENTRY(ret_from_kernel_thread)
|
||||
addk r3, r0, r0
|
||||
|
||||
work_pending:
|
||||
lwi r11, r1, PT_MODE
|
||||
bneid r11, 2f
|
||||
3:
|
||||
enable_irq
|
||||
|
||||
andi r11, r19, _TIF_NEED_RESCHED
|
||||
beqi r11, 1f
|
||||
bralid r15, schedule
|
||||
nop
|
||||
bri 4f
|
||||
1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME
|
||||
beqi r11, no_work_pending
|
||||
addk r5, r1, r0
|
||||
addk r5, r30, r0
|
||||
bralid r15, do_notify_resume
|
||||
addik r6, r0, 1
|
||||
bri no_work_pending
|
||||
addk r30, r0, r0 /* no restarts from now on */
|
||||
4:
|
||||
disable_irq
|
||||
lwi r6, r31, TS_THREAD_INFO /* get thread info */
|
||||
lwi r19, r6, TI_FLAGS /* get flags in thread info */
|
||||
bri 3b
|
||||
|
||||
ENTRY(ret_to_user)
|
||||
disable_irq
|
||||
@ -507,6 +520,7 @@ ENTRY(ret_to_user)
|
||||
no_work_pending:
|
||||
disable_irq
|
||||
|
||||
2:
|
||||
/* save r31 */
|
||||
swi r31, r0, PER_CPU(CURRENT_SAVE)
|
||||
/* save mode indicator */
|
||||
@ -559,6 +573,7 @@ no_work_pending:
|
||||
nop
|
||||
|
||||
sys_rt_sigreturn_wrapper:
|
||||
addk r30, r0, r0 /* no restarts for this one */
|
||||
brid sys_rt_sigreturn
|
||||
addk r5, r1, r0
|
||||
|
||||
|
@ -354,6 +354,7 @@ C_ENTRY(_user_exception):
|
||||
/* Note Microblaze barrel shift is optional, so don't rely on it */
|
||||
add r12, r12, r12; /* convert num -> ptr */
|
||||
add r12, r12, r12;
|
||||
addi r30, r0, 1 /* restarts allowed */
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Trac syscalls and stored them to syscall_debug_table */
|
||||
@ -401,26 +402,27 @@ C_ENTRY(ret_from_trap):
|
||||
* trigger rescheduling. */
|
||||
/* get thread info from current task */
|
||||
lwi r11, CURRENT_TASK, TS_THREAD_INFO;
|
||||
lwi r11, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r11, _TIF_NEED_RESCHED;
|
||||
lwi r19, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r19, _TIF_NEED_RESCHED;
|
||||
beqi r11, 5f;
|
||||
|
||||
bralid r15, schedule; /* Call scheduler */
|
||||
nop; /* delay slot */
|
||||
bri 1b
|
||||
|
||||
/* Maybe handle a signal */
|
||||
5: /* get thread info from current task*/
|
||||
lwi r11, CURRENT_TASK, TS_THREAD_INFO;
|
||||
lwi r11, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
|
||||
beqi r11, 1f; /* Signals to handle, handle them */
|
||||
5:
|
||||
andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
|
||||
beqi r11, 4f; /* Signals to handle, handle them */
|
||||
|
||||
addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */
|
||||
bralid r15, do_notify_resume; /* Handle any signals */
|
||||
addi r6, r0, 1; /* Arg 2: int in_syscall */
|
||||
add r6, r30, r0; /* Arg 2: int in_syscall */
|
||||
add r30, r0, r0 /* no more restarts */
|
||||
bri 1b
|
||||
|
||||
/* Finally, return to user state. */
|
||||
1: set_bip; /* Ints masked for state restore */
|
||||
4: set_bip; /* Ints masked for state restore */
|
||||
swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */
|
||||
VM_OFF;
|
||||
tophys(r1,r1);
|
||||
@ -464,6 +466,7 @@ C_ENTRY(ret_from_kernel_thread):
|
||||
add r3, r0, r0
|
||||
|
||||
C_ENTRY(sys_rt_sigreturn_wrapper):
|
||||
addik r30, r0, 0 /* no restarts */
|
||||
brid sys_rt_sigreturn /* Do real work */
|
||||
addik r5, r1, 0; /* add user context as 1st arg */
|
||||
|
||||
@ -571,20 +574,20 @@ C_ENTRY(ret_from_exc):
|
||||
|
||||
/* We're returning to user mode, so check for various conditions that
|
||||
trigger rescheduling. */
|
||||
1:
|
||||
lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */
|
||||
lwi r11, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r11, _TIF_NEED_RESCHED;
|
||||
lwi r19, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r19, _TIF_NEED_RESCHED;
|
||||
beqi r11, 5f;
|
||||
|
||||
/* Call the scheduler before returning from a syscall/trap. */
|
||||
bralid r15, schedule; /* Call scheduler */
|
||||
nop; /* delay slot */
|
||||
bri 1b
|
||||
|
||||
/* Maybe handle a signal */
|
||||
5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */
|
||||
lwi r11, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
|
||||
beqi r11, 1f; /* Signals to handle, handle them */
|
||||
5: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
|
||||
beqi r11, 4f; /* Signals to handle, handle them */
|
||||
|
||||
/*
|
||||
* Handle a signal return; Pending signals should be in r18.
|
||||
@ -600,9 +603,10 @@ C_ENTRY(ret_from_exc):
|
||||
addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */
|
||||
bralid r15, do_notify_resume; /* Handle any signals */
|
||||
addi r6, r0, 0; /* Arg 2: int in_syscall */
|
||||
bri 1b
|
||||
|
||||
/* Finally, return to user state. */
|
||||
1: set_bip; /* Ints masked for state restore */
|
||||
4: set_bip; /* Ints masked for state restore */
|
||||
swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */
|
||||
VM_OFF;
|
||||
tophys(r1,r1);
|
||||
@ -682,22 +686,23 @@ ret_from_irq:
|
||||
lwi r11, r1, PT_MODE;
|
||||
bnei r11, 2f;
|
||||
|
||||
1:
|
||||
lwi r11, CURRENT_TASK, TS_THREAD_INFO;
|
||||
lwi r11, r11, TI_FLAGS; /* MS: get flags from thread info */
|
||||
andi r11, r11, _TIF_NEED_RESCHED;
|
||||
lwi r19, r11, TI_FLAGS; /* MS: get flags from thread info */
|
||||
andi r11, r19, _TIF_NEED_RESCHED;
|
||||
beqi r11, 5f
|
||||
bralid r15, schedule;
|
||||
nop; /* delay slot */
|
||||
bri 1b
|
||||
|
||||
/* Maybe handle a signal */
|
||||
5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* MS: get thread info */
|
||||
lwi r11, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
|
||||
5: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
|
||||
beqid r11, no_intr_resched
|
||||
/* Handle a signal return; Pending signals should be in r18. */
|
||||
addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */
|
||||
bralid r15, do_notify_resume; /* Handle any signals */
|
||||
addi r6, r0, 0; /* Arg 2: int in_syscall */
|
||||
bri 1b
|
||||
|
||||
/* Finally, return to user state. */
|
||||
no_intr_resched:
|
||||
@ -815,28 +820,29 @@ dbtrap_call: /* Return point for kernel/user entry + 8 because of rtsd r15, 8 */
|
||||
lwi r11, r1, PT_MODE;
|
||||
bnei r11, 2f;
|
||||
/* MS: Return to user space - gdb */
|
||||
1:
|
||||
/* Get current task ptr into r11 */
|
||||
lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */
|
||||
lwi r11, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r11, _TIF_NEED_RESCHED;
|
||||
lwi r19, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r19, _TIF_NEED_RESCHED;
|
||||
beqi r11, 5f;
|
||||
|
||||
/* Call the scheduler before returning from a syscall/trap. */
|
||||
bralid r15, schedule; /* Call scheduler */
|
||||
nop; /* delay slot */
|
||||
bri 1b
|
||||
|
||||
/* Maybe handle a signal */
|
||||
5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */
|
||||
lwi r11, r11, TI_FLAGS; /* get flags in thread info */
|
||||
andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
|
||||
beqi r11, 1f; /* Signals to handle, handle them */
|
||||
5: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
|
||||
beqi r11, 4f; /* Signals to handle, handle them */
|
||||
|
||||
addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */
|
||||
bralid r15, do_notify_resume; /* Handle any signals */
|
||||
addi r6, r0, 0; /* Arg 2: int in_syscall */
|
||||
bri 1b
|
||||
|
||||
/* Finally, return to user state. */
|
||||
1: swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */
|
||||
4: swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */
|
||||
VM_OFF;
|
||||
tophys(r1,r1);
|
||||
/* MS: Restore all regs */
|
||||
|
@ -164,29 +164,6 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
|
||||
tracehook_report_syscall_exit(regs, step);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static asmlinkage void syscall_trace(void)
|
||||
{
|
||||
if (!test_thread_flag(TIF_SYSCALL_TRACE))
|
||||
return;
|
||||
if (!(current->ptrace & PT_PTRACED))
|
||||
return;
|
||||
/* The 0x80 provides a way for the tracing parent to distinguish
|
||||
between a syscall stop and SIGTRAP delivery */
|
||||
ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
|
||||
? 0x80 : 0));
|
||||
/*
|
||||
* this isn't the same as continuing with a signal, but it will do
|
||||
* for normal use. strace only continues with a signal if the
|
||||
* stopping signal is not SIGTRAP. -brl
|
||||
*/
|
||||
if (current->exit_code) {
|
||||
send_sig(current->exit_code, current, 1);
|
||||
current->exit_code = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void ptrace_disable(struct task_struct *child)
|
||||
{
|
||||
/* nothing to do */
|
||||
|
@ -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.
|
||||
*/
|
||||
@ -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;
|
||||
@ -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));
|
||||
@ -356,15 +343,6 @@ static void do_signal(struct pt_regs *regs, int in_syscall)
|
||||
|
||||
asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall)
|
||||
{
|
||||
/*
|
||||
* We want the common case to go fast, which
|
||||
* is why we may in certain cases get here from
|
||||
* kernel mode. Just return without doing anything
|
||||
* if so.
|
||||
*/
|
||||
if (kernel_mode(regs))
|
||||
return;
|
||||
|
||||
if (test_thread_flag(TIF_SIGPENDING))
|
||||
do_signal(regs, in_syscall);
|
||||
|
||||
|
@ -41,6 +41,12 @@ config MIPS
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select MODULES_USE_ELF_REL if MODULES
|
||||
select MODULES_USE_ELF_RELA if MODULES && 64BIT
|
||||
select CLONE_BACKWARDS
|
||||
select GENERIC_SIGALTSTACK
|
||||
select GENERIC_COMPAT_RT_SIGACTION
|
||||
select GENERIC_COMPAT_RT_SIGQUEUEINFO
|
||||
select GENERIC_COMPAT_RT_SIGPROCMASK
|
||||
select GENERIC_COMPAT_RT_SIGPENDING
|
||||
|
||||
menu "Machine selection"
|
||||
|
||||
|
@ -288,6 +288,14 @@ struct compat_shmid64_ds {
|
||||
compat_ulong_t __unused2;
|
||||
};
|
||||
|
||||
/* MIPS has unusual order of fields in stack_t */
|
||||
typedef struct compat_sigaltstack {
|
||||
compat_uptr_t ss_sp;
|
||||
compat_size_t ss_size;
|
||||
int ss_flags;
|
||||
} compat_stack_t;
|
||||
#define compat_sigaltstack compat_sigaltstack
|
||||
|
||||
static inline int is_compat_task(void)
|
||||
{
|
||||
return test_thread_flag(TIF_32BIT_ADDR);
|
||||
|
@ -20,10 +20,10 @@
|
||||
#define save_static_function(symbol) \
|
||||
__asm__( \
|
||||
".text\n\t" \
|
||||
".globl\t" #symbol "\n\t" \
|
||||
".globl\t__" #symbol "\n\t" \
|
||||
".align\t2\n\t" \
|
||||
".type\t" #symbol ", @function\n\t" \
|
||||
".ent\t" #symbol ", 0\n" \
|
||||
".type\t__" #symbol ", @function\n\t" \
|
||||
".ent\t__" #symbol ", 0\n__" \
|
||||
#symbol":\n\t" \
|
||||
".frame\t$29, 0, $31\n\t" \
|
||||
"sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \
|
||||
@ -35,9 +35,9 @@ __asm__( \
|
||||
"sw\t$22,"__str(PT_R22)"($29)\n\t" \
|
||||
"sw\t$23,"__str(PT_R23)"($29)\n\t" \
|
||||
"sw\t$30,"__str(PT_R30)"($29)\n\t" \
|
||||
"j\t_" #symbol "\n\t" \
|
||||
".end\t" #symbol "\n\t" \
|
||||
".size\t" #symbol",. - " #symbol)
|
||||
"j\t" #symbol "\n\t" \
|
||||
".end\t__" #symbol "\n\t" \
|
||||
".size\t__" #symbol",. - __" #symbol)
|
||||
|
||||
#define nabi_no_regargs
|
||||
|
||||
@ -48,10 +48,10 @@ __asm__( \
|
||||
#define save_static_function(symbol) \
|
||||
__asm__( \
|
||||
".text\n\t" \
|
||||
".globl\t" #symbol "\n\t" \
|
||||
".globl\t__" #symbol "\n\t" \
|
||||
".align\t2\n\t" \
|
||||
".type\t" #symbol ", @function\n\t" \
|
||||
".ent\t" #symbol ", 0\n" \
|
||||
".type\t__" #symbol ", @function\n\t" \
|
||||
".ent\t__" #symbol ", 0\n__" \
|
||||
#symbol":\n\t" \
|
||||
".frame\t$29, 0, $31\n\t" \
|
||||
"sd\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \
|
||||
@ -63,9 +63,9 @@ __asm__( \
|
||||
"sd\t$22,"__str(PT_R22)"($29)\n\t" \
|
||||
"sd\t$23,"__str(PT_R23)"($29)\n\t" \
|
||||
"sd\t$30,"__str(PT_R30)"($29)\n\t" \
|
||||
"j\t_" #symbol "\n\t" \
|
||||
".end\t" #symbol "\n\t" \
|
||||
".size\t" #symbol",. - " #symbol)
|
||||
"j\t" #symbol "\n\t" \
|
||||
".end\t__" #symbol "\n\t" \
|
||||
".size\t__" #symbol",. - __" #symbol)
|
||||
|
||||
#define nabi_no_regargs \
|
||||
unsigned long __dummy0, \
|
||||
|
@ -43,6 +43,8 @@
|
||||
# ifdef CONFIG_MIPS32_O32
|
||||
# define __ARCH_WANT_COMPAT_SYS_TIME
|
||||
# endif
|
||||
#define __ARCH_WANT_SYS_FORK
|
||||
#define __ARCH_WANT_SYS_CLONE
|
||||
|
||||
/* whitelists for checksyscalls */
|
||||
#define __IGNORE_select
|
||||
|
@ -119,22 +119,6 @@ SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf,
|
||||
return sys_pwrite64(fd, buf, count, merge_64(a4, a5));
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE2(32_sched_rr_get_interval, compat_pid_t, pid,
|
||||
struct compat_timespec __user *, interval)
|
||||
{
|
||||
struct timespec t;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t);
|
||||
set_fs(old_fs);
|
||||
if (put_user (t.tv_sec, &interval->tv_sec) ||
|
||||
__put_user(t.tv_nsec, &interval->tv_nsec))
|
||||
return -EFAULT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYSVIPC
|
||||
|
||||
SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third,
|
||||
@ -295,27 +279,6 @@ asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_a2,
|
||||
merge_64(len_a4, len_a5));
|
||||
}
|
||||
|
||||
save_static_function(sys32_clone);
|
||||
static int noinline __used
|
||||
_sys32_clone(nabi_no_regargs struct pt_regs regs)
|
||||
{
|
||||
unsigned long clone_flags;
|
||||
unsigned long newsp;
|
||||
int __user *parent_tidptr, *child_tidptr;
|
||||
|
||||
clone_flags = regs.regs[4];
|
||||
newsp = regs.regs[5];
|
||||
if (!newsp)
|
||||
newsp = regs.regs[29];
|
||||
parent_tidptr = (int __user *) regs.regs[6];
|
||||
|
||||
/* Use __dummy4 instead of getting it off the stack, so that
|
||||
syscall() works. */
|
||||
child_tidptr = (int __user *) __dummy4;
|
||||
return do_fork(clone_flags, newsp, 0,
|
||||
parent_tidptr, child_tidptr);
|
||||
}
|
||||
|
||||
asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf,
|
||||
size_t len)
|
||||
{
|
||||
@ -328,10 +291,3 @@ SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags,
|
||||
return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4),
|
||||
dfd, pathname);
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE6(32_futex, u32 __user *, uaddr, int, op, u32, val,
|
||||
struct compat_timespec __user *, utime, u32 __user *, uaddr2,
|
||||
u32, val3)
|
||||
{
|
||||
return compat_sys_futex(uaddr, op, val, utime, uaddr2, val3);
|
||||
}
|
||||
|
@ -156,7 +156,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||
*childregs = *regs;
|
||||
childregs->regs[7] = 0; /* Clear error flag */
|
||||
childregs->regs[2] = 0; /* Child gets zero as return value */
|
||||
childregs->regs[29] = usp;
|
||||
if (usp)
|
||||
childregs->regs[29] = usp;
|
||||
ti->addr_limit = USER_DS;
|
||||
|
||||
p->thread.reg29 = (unsigned long) childregs;
|
||||
|
@ -226,7 +226,7 @@ einval: li v0, -ENOSYS
|
||||
.macro syscalltable
|
||||
sys sys_syscall 8 /* 4000 */
|
||||
sys sys_exit 1
|
||||
sys sys_fork 0
|
||||
sys __sys_fork 0
|
||||
sys sys_read 3
|
||||
sys sys_write 3
|
||||
sys sys_open 3 /* 4005 */
|
||||
@ -344,7 +344,7 @@ einval: li v0, -ENOSYS
|
||||
sys sys_ipc 6
|
||||
sys sys_fsync 1
|
||||
sys sys_sigreturn 0
|
||||
sys sys_clone 0 /* 4120 */
|
||||
sys __sys_clone 6 /* 4120 */
|
||||
sys sys_setdomainname 2
|
||||
sys sys_newuname 1
|
||||
sys sys_ni_syscall 0 /* sys_modify_ldt */
|
||||
|
@ -170,8 +170,8 @@ sys_call_table:
|
||||
PTR sys_socketpair
|
||||
PTR sys_setsockopt
|
||||
PTR sys_getsockopt
|
||||
PTR sys_clone /* 5055 */
|
||||
PTR sys_fork
|
||||
PTR __sys_clone /* 5055 */
|
||||
PTR __sys_fork
|
||||
PTR sys_execve
|
||||
PTR sys_exit
|
||||
PTR sys_wait4
|
||||
|
@ -117,8 +117,8 @@ EXPORT(sysn32_call_table)
|
||||
PTR sys_mprotect /* 6010 */
|
||||
PTR sys_munmap
|
||||
PTR sys_brk
|
||||
PTR sys_32_rt_sigaction
|
||||
PTR sys_32_rt_sigprocmask
|
||||
PTR compat_sys_rt_sigaction
|
||||
PTR compat_sys_rt_sigprocmask
|
||||
PTR compat_sys_ioctl /* 6015 */
|
||||
PTR sys_pread64
|
||||
PTR sys_pwrite64
|
||||
@ -159,8 +159,8 @@ EXPORT(sysn32_call_table)
|
||||
PTR sys_socketpair
|
||||
PTR compat_sys_setsockopt
|
||||
PTR sys_getsockopt
|
||||
PTR sys_clone /* 6055 */
|
||||
PTR sys_fork
|
||||
PTR __sys_clone /* 6055 */
|
||||
PTR __sys_fork
|
||||
PTR compat_sys_execve
|
||||
PTR sys_exit
|
||||
PTR compat_sys_wait4
|
||||
@ -229,11 +229,11 @@ EXPORT(sysn32_call_table)
|
||||
PTR sys_getsid
|
||||
PTR sys_capget
|
||||
PTR sys_capset
|
||||
PTR sys_32_rt_sigpending /* 6125 */
|
||||
PTR compat_sys_rt_sigpending /* 6125 */
|
||||
PTR compat_sys_rt_sigtimedwait
|
||||
PTR sys_32_rt_sigqueueinfo
|
||||
PTR sysn32_rt_sigsuspend
|
||||
PTR sys32_sigaltstack
|
||||
PTR compat_sys_rt_sigqueueinfo
|
||||
PTR compat_sys_rt_sigsuspend
|
||||
PTR compat_sys_sigaltstack
|
||||
PTR compat_sys_utime /* 6130 */
|
||||
PTR sys_mknod
|
||||
PTR sys_32_personality
|
||||
@ -249,7 +249,7 @@ EXPORT(sysn32_call_table)
|
||||
PTR sys_sched_getscheduler
|
||||
PTR sys_sched_get_priority_max
|
||||
PTR sys_sched_get_priority_min
|
||||
PTR sys_32_sched_rr_get_interval /* 6145 */
|
||||
PTR compat_sys_sched_rr_get_interval /* 6145 */
|
||||
PTR sys_mlock
|
||||
PTR sys_munlock
|
||||
PTR sys_mlockall
|
||||
@ -298,7 +298,7 @@ EXPORT(sysn32_call_table)
|
||||
PTR sys_fremovexattr
|
||||
PTR sys_tkill
|
||||
PTR sys_ni_syscall
|
||||
PTR sys_32_futex
|
||||
PTR compat_sys_futex
|
||||
PTR compat_sys_sched_setaffinity /* 6195 */
|
||||
PTR compat_sys_sched_getaffinity
|
||||
PTR sys_cacheflush
|
||||
|
@ -194,7 +194,7 @@ einval: li v0, -ENOSYS
|
||||
sys_call_table:
|
||||
PTR sys32_syscall /* 4000 */
|
||||
PTR sys_exit
|
||||
PTR sys_fork
|
||||
PTR __sys_fork
|
||||
PTR sys_read
|
||||
PTR sys_write
|
||||
PTR compat_sys_open /* 4005 */
|
||||
@ -312,7 +312,7 @@ sys_call_table:
|
||||
PTR sys_32_ipc
|
||||
PTR sys_fsync
|
||||
PTR sys32_sigreturn
|
||||
PTR sys32_clone /* 4120 */
|
||||
PTR __sys_clone /* 4120 */
|
||||
PTR sys_setdomainname
|
||||
PTR sys_newuname
|
||||
PTR sys_ni_syscall /* sys_modify_ldt */
|
||||
@ -357,7 +357,7 @@ sys_call_table:
|
||||
PTR sys_sched_yield
|
||||
PTR sys_sched_get_priority_max
|
||||
PTR sys_sched_get_priority_min
|
||||
PTR sys_32_sched_rr_get_interval /* 4165 */
|
||||
PTR compat_sys_sched_rr_get_interval /* 4165 */
|
||||
PTR compat_sys_nanosleep
|
||||
PTR sys_mremap
|
||||
PTR sys_accept
|
||||
@ -386,19 +386,19 @@ sys_call_table:
|
||||
PTR sys_getresgid
|
||||
PTR sys_prctl
|
||||
PTR sys32_rt_sigreturn
|
||||
PTR sys_32_rt_sigaction
|
||||
PTR sys_32_rt_sigprocmask /* 4195 */
|
||||
PTR sys_32_rt_sigpending
|
||||
PTR compat_sys_rt_sigaction
|
||||
PTR compat_sys_rt_sigprocmask /* 4195 */
|
||||
PTR compat_sys_rt_sigpending
|
||||
PTR compat_sys_rt_sigtimedwait
|
||||
PTR sys_32_rt_sigqueueinfo
|
||||
PTR sys32_rt_sigsuspend
|
||||
PTR compat_sys_rt_sigqueueinfo
|
||||
PTR compat_sys_rt_sigsuspend
|
||||
PTR sys_32_pread /* 4200 */
|
||||
PTR sys_32_pwrite
|
||||
PTR sys_chown
|
||||
PTR sys_getcwd
|
||||
PTR sys_capget
|
||||
PTR sys_capset /* 4205 */
|
||||
PTR sys32_sigaltstack
|
||||
PTR compat_sys_sigaltstack
|
||||
PTR sys_32_sendfile
|
||||
PTR sys_ni_syscall
|
||||
PTR sys_ni_syscall
|
||||
@ -430,7 +430,7 @@ sys_call_table:
|
||||
PTR sys_fremovexattr /* 4235 */
|
||||
PTR sys_tkill
|
||||
PTR sys_sendfile64
|
||||
PTR sys_32_futex
|
||||
PTR compat_sys_futex
|
||||
PTR compat_sys_sched_setaffinity
|
||||
PTR compat_sys_sched_getaffinity /* 4240 */
|
||||
PTR compat_sys_io_setup
|
||||
@ -470,7 +470,7 @@ sys_call_table:
|
||||
PTR compat_sys_mq_notify /* 4275 */
|
||||
PTR compat_sys_mq_getsetattr
|
||||
PTR sys_ni_syscall /* sys_vserver */
|
||||
PTR sys_32_waitid
|
||||
PTR compat_sys_waitid
|
||||
PTR sys_ni_syscall /* available, was setaltroot */
|
||||
PTR sys_add_key /* 4280 */
|
||||
PTR sys_request_key
|
||||
|
@ -247,31 +247,12 @@ void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_TRAD_SIGNALS
|
||||
asmlinkage int sys_sigsuspend(nabi_no_regargs struct pt_regs regs)
|
||||
SYSCALL_DEFINE1(sigsuspend, sigset_t __user *, uset)
|
||||
{
|
||||
sigset_t newset;
|
||||
sigset_t __user *uset;
|
||||
|
||||
uset = (sigset_t __user *) regs.regs[4];
|
||||
if (copy_from_user(&newset, uset, sizeof(sigset_t)))
|
||||
return -EFAULT;
|
||||
return sigsuspend(&newset);
|
||||
return sys_rt_sigsuspend(uset, sizeof(sigset_t));
|
||||
}
|
||||
#endif
|
||||
|
||||
SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *,unewset, size_t, sigsetsize)
|
||||
{
|
||||
sigset_t newset;
|
||||
|
||||
/* XXX Don't preclude handling different sized sigset_t's. */
|
||||
if (sigsetsize != sizeof(sigset_t))
|
||||
return -EINVAL;
|
||||
|
||||
if (copy_from_user(&newset, unewset, sizeof(newset)))
|
||||
return -EFAULT;
|
||||
return sigsuspend(&newset);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TRAD_SIGNALS
|
||||
SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act,
|
||||
struct sigaction __user *, oact)
|
||||
@ -313,15 +294,6 @@ SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act,
|
||||
}
|
||||
#endif
|
||||
|
||||
asmlinkage int sys_sigaltstack(nabi_no_regargs 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[29];
|
||||
|
||||
return do_sigaltstack(uss, uoss, usp);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TRAD_SIGNALS
|
||||
asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs)
|
||||
{
|
||||
@ -378,9 +350,8 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
|
||||
else if (sig)
|
||||
force_sig(sig, current);
|
||||
|
||||
/* It is more difficult to avoid calling this function than to
|
||||
call it and ignore errors. */
|
||||
do_sigaltstack(&frame->rs_uc.uc_stack, NULL, regs.regs[29]);
|
||||
if (restore_altstack(&frame->rs_uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
/*
|
||||
* Don't let your children do this ...
|
||||
@ -457,12 +428,7 @@ static int setup_rt_frame(void *sig_return, struct k_sigaction *ka,
|
||||
/* Create the ucontext. */
|
||||
err |= __put_user(0, &frame->rs_uc.uc_flags);
|
||||
err |= __put_user(NULL, &frame->rs_uc.uc_link);
|
||||
err |= __put_user((void __user *)current->sas_ss_sp,
|
||||
&frame->rs_uc.uc_stack.ss_sp);
|
||||
err |= __put_user(sas_ss_flags(regs->regs[29]),
|
||||
&frame->rs_uc.uc_stack.ss_flags);
|
||||
err |= __put_user(current->sas_ss_size,
|
||||
&frame->rs_uc.uc_stack.ss_size);
|
||||
err |= __save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]);
|
||||
err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext);
|
||||
err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set));
|
||||
|
||||
|
@ -55,23 +55,10 @@ extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 __user
|
||||
typedef unsigned int __sighandler32_t;
|
||||
typedef void (*vfptr_t)(void);
|
||||
|
||||
struct sigaction32 {
|
||||
unsigned int sa_flags;
|
||||
__sighandler32_t sa_handler;
|
||||
compat_sigset_t sa_mask;
|
||||
};
|
||||
|
||||
/* IRIX compatible stack_t */
|
||||
typedef struct sigaltstack32 {
|
||||
s32 ss_sp;
|
||||
compat_size_t ss_size;
|
||||
int ss_flags;
|
||||
} stack32_t;
|
||||
|
||||
struct ucontext32 {
|
||||
u32 uc_flags;
|
||||
s32 uc_link;
|
||||
stack32_t uc_stack;
|
||||
compat_stack_t uc_stack;
|
||||
struct sigcontext32 uc_mcontext;
|
||||
compat_sigset_t uc_sigmask; /* mask last for extensibility */
|
||||
};
|
||||
@ -280,36 +267,13 @@ static inline int get_sigset(sigset_t *kbuf, const compat_sigset_t __user *ubuf)
|
||||
* Atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
|
||||
asmlinkage int sys32_sigsuspend(nabi_no_regargs struct pt_regs regs)
|
||||
asmlinkage int sys32_sigsuspend(compat_sigset_t __user *uset)
|
||||
{
|
||||
compat_sigset_t __user *uset;
|
||||
sigset_t newset;
|
||||
|
||||
uset = (compat_sigset_t __user *) regs.regs[4];
|
||||
if (get_sigset(&newset, uset))
|
||||
return -EFAULT;
|
||||
return sigsuspend(&newset);
|
||||
return compat_sys_rt_sigsuspend(uset, sizeof(compat_sigset_t));
|
||||
}
|
||||
|
||||
asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
|
||||
{
|
||||
compat_sigset_t __user *uset;
|
||||
sigset_t newset;
|
||||
size_t sigsetsize;
|
||||
|
||||
/* XXX Don't preclude handling different sized sigset_t's. */
|
||||
sigsetsize = regs.regs[5];
|
||||
if (sigsetsize != sizeof(compat_sigset_t))
|
||||
return -EINVAL;
|
||||
|
||||
uset = (compat_sigset_t __user *) regs.regs[4];
|
||||
if (get_sigset(&newset, uset))
|
||||
return -EFAULT;
|
||||
return sigsuspend(&newset);
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act,
|
||||
struct sigaction32 __user *, oact)
|
||||
SYSCALL_DEFINE3(32_sigaction, long, sig, const struct compat_sigaction __user *, act,
|
||||
struct compat_sigaction __user *, oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
@ -350,45 +314,6 @@ SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act,
|
||||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage int sys32_sigaltstack(nabi_no_regargs struct pt_regs regs)
|
||||
{
|
||||
const stack32_t __user *uss = (const stack32_t __user *) regs.regs[4];
|
||||
stack32_t __user *uoss = (stack32_t __user *) regs.regs[5];
|
||||
unsigned long usp = regs.regs[29];
|
||||
stack_t kss, koss;
|
||||
int ret, err = 0;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
s32 sp;
|
||||
|
||||
if (uss) {
|
||||
if (!access_ok(VERIFY_READ, uss, sizeof(*uss)))
|
||||
return -EFAULT;
|
||||
err |= __get_user(sp, &uss->ss_sp);
|
||||
kss.ss_sp = (void __user *) (long) sp;
|
||||
err |= __get_user(kss.ss_size, &uss->ss_size);
|
||||
err |= __get_user(kss.ss_flags, &uss->ss_flags);
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
ret = do_sigaltstack(uss ? (stack_t __user *)&kss : NULL,
|
||||
uoss ? (stack_t __user *)&koss : NULL, usp);
|
||||
set_fs(old_fs);
|
||||
|
||||
if (!ret && uoss) {
|
||||
if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss)))
|
||||
return -EFAULT;
|
||||
sp = (int) (unsigned long) koss.ss_sp;
|
||||
err |= __put_user(sp, &uoss->ss_sp);
|
||||
err |= __put_user(koss.ss_size, &uoss->ss_size);
|
||||
err |= __put_user(koss.ss_flags, &uoss->ss_flags);
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
|
||||
{
|
||||
int err;
|
||||
@ -490,10 +415,7 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs)
|
||||
asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
|
||||
{
|
||||
struct rt_sigframe32 __user *frame;
|
||||
mm_segment_t old_fs;
|
||||
sigset_t set;
|
||||
stack_t st;
|
||||
s32 sp;
|
||||
int sig;
|
||||
|
||||
frame = (struct rt_sigframe32 __user *) regs.regs[29];
|
||||
@ -510,21 +432,8 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
|
||||
else if (sig)
|
||||
force_sig(sig, current);
|
||||
|
||||
/* The ucontext contains a stack32_t, so we must convert! */
|
||||
if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
|
||||
if (compat_restore_altstack(&frame->rs_uc.uc_stack))
|
||||
goto badframe;
|
||||
st.ss_sp = (void __user *)(long) sp;
|
||||
if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
|
||||
goto badframe;
|
||||
if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
|
||||
goto badframe;
|
||||
|
||||
/* It is more difficult to avoid calling this function than to
|
||||
call it and ignore errors. */
|
||||
old_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]);
|
||||
set_fs(old_fs);
|
||||
|
||||
/*
|
||||
* Don't let your children do this ...
|
||||
@ -590,7 +499,6 @@ static int setup_rt_frame_32(void *sig_return, struct k_sigaction *ka,
|
||||
{
|
||||
struct rt_sigframe32 __user *frame;
|
||||
int err = 0;
|
||||
s32 sp;
|
||||
|
||||
frame = get_sigframe(ka, regs, sizeof(*frame));
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
|
||||
@ -602,13 +510,7 @@ static int setup_rt_frame_32(void *sig_return, struct k_sigaction *ka,
|
||||
/* Create the ucontext. */
|
||||
err |= __put_user(0, &frame->rs_uc.uc_flags);
|
||||
err |= __put_user(0, &frame->rs_uc.uc_link);
|
||||
sp = (int) (long) current->sas_ss_sp;
|
||||
err |= __put_user(sp,
|
||||
&frame->rs_uc.uc_stack.ss_sp);
|
||||
err |= __put_user(sas_ss_flags(regs->regs[29]),
|
||||
&frame->rs_uc.uc_stack.ss_flags);
|
||||
err |= __put_user(current->sas_ss_size,
|
||||
&frame->rs_uc.uc_stack.ss_size);
|
||||
err |= __compat_save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]);
|
||||
err |= setup_sigcontext32(regs, &frame->rs_uc.uc_mcontext);
|
||||
err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set);
|
||||
|
||||
@ -656,131 +558,6 @@ struct mips_abi mips_abi_32 = {
|
||||
.restart = __NR_O32_restart_syscall
|
||||
};
|
||||
|
||||
SYSCALL_DEFINE4(32_rt_sigaction, int, sig,
|
||||
const struct sigaction32 __user *, act,
|
||||
struct sigaction32 __user *, oact, unsigned int, sigsetsize)
|
||||
{
|
||||
struct k_sigaction new_sa, old_sa;
|
||||
int ret = -EINVAL;
|
||||
|
||||
/* XXX: Don't preclude handling different sized sigset_t's. */
|
||||
if (sigsetsize != sizeof(sigset_t))
|
||||
goto out;
|
||||
|
||||
if (act) {
|
||||
s32 handler;
|
||||
int err = 0;
|
||||
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)))
|
||||
return -EFAULT;
|
||||
err |= __get_user(handler, &act->sa_handler);
|
||||
new_sa.sa.sa_handler = (void __user *)(s64)handler;
|
||||
err |= __get_user(new_sa.sa.sa_flags, &act->sa_flags);
|
||||
err |= get_sigset(&new_sa.sa.sa_mask, &act->sa_mask);
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
int err = 0;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
|
||||
return -EFAULT;
|
||||
|
||||
err |= __put_user((u32)(u64)old_sa.sa.sa_handler,
|
||||
&oact->sa_handler);
|
||||
err |= __put_user(old_sa.sa.sa_flags, &oact->sa_flags);
|
||||
err |= put_sigset(&old_sa.sa.sa_mask, &oact->sa_mask);
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
}
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE4(32_rt_sigprocmask, int, how, compat_sigset_t __user *, set,
|
||||
compat_sigset_t __user *, oset, unsigned int, sigsetsize)
|
||||
{
|
||||
sigset_t old_set, new_set;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
if (set && get_sigset(&new_set, set))
|
||||
return -EFAULT;
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
ret = sys_rt_sigprocmask(how, set ? (sigset_t __user *)&new_set : NULL,
|
||||
oset ? (sigset_t __user *)&old_set : NULL,
|
||||
sigsetsize);
|
||||
set_fs(old_fs);
|
||||
|
||||
if (!ret && oset && put_sigset(&old_set, oset))
|
||||
return -EFAULT;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE2(32_rt_sigpending, compat_sigset_t __user *, uset,
|
||||
unsigned int, sigsetsize)
|
||||
{
|
||||
int ret;
|
||||
sigset_t set;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
ret = sys_rt_sigpending((sigset_t __user *)&set, sigsetsize);
|
||||
set_fs(old_fs);
|
||||
|
||||
if (!ret && put_sigset(&set, uset))
|
||||
return -EFAULT;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE3(32_rt_sigqueueinfo, int, pid, int, sig,
|
||||
compat_siginfo_t __user *, uinfo)
|
||||
{
|
||||
siginfo_t info;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
if (copy_from_user(&info, uinfo, 3*sizeof(int)) ||
|
||||
copy_from_user(info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE))
|
||||
return -EFAULT;
|
||||
set_fs(KERNEL_DS);
|
||||
ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info);
|
||||
set_fs(old_fs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE5(32_waitid, int, which, compat_pid_t, pid,
|
||||
compat_siginfo_t __user *, uinfo, int, options,
|
||||
struct compat_rusage __user *, uru)
|
||||
{
|
||||
siginfo_t info;
|
||||
struct rusage ru;
|
||||
long ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
info.si_signo = 0;
|
||||
set_fs(KERNEL_DS);
|
||||
ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
|
||||
uru ? (struct rusage __user *) &ru : NULL);
|
||||
set_fs(old_fs);
|
||||
|
||||
if (ret < 0 || info.si_signo == 0)
|
||||
return ret;
|
||||
|
||||
if (uru && (ret = put_compat_rusage(&ru, uru)))
|
||||
return ret;
|
||||
|
||||
BUG_ON(info.si_code & __SI_MASK);
|
||||
info.si_code |= __SI_CHLD;
|
||||
return copy_siginfo_to_user32(uinfo, &info);
|
||||
}
|
||||
|
||||
static int signal32_init(void)
|
||||
{
|
||||
if (cpu_has_fpu) {
|
||||
|
@ -50,18 +50,10 @@
|
||||
extern int setup_sigcontext(struct pt_regs *, struct sigcontext __user *);
|
||||
extern int restore_sigcontext(struct pt_regs *, struct sigcontext __user *);
|
||||
|
||||
|
||||
/* IRIX compatible stack_t */
|
||||
typedef struct sigaltstack32 {
|
||||
s32 ss_sp;
|
||||
compat_size_t ss_size;
|
||||
int ss_flags;
|
||||
} stack32_t;
|
||||
|
||||
struct ucontextn32 {
|
||||
u32 uc_flags;
|
||||
s32 uc_link;
|
||||
stack32_t uc_stack;
|
||||
compat_stack_t uc_stack;
|
||||
struct sigcontext uc_mcontext;
|
||||
compat_sigset_t uc_sigmask; /* mask last for extensibility */
|
||||
};
|
||||
@ -73,34 +65,10 @@ struct rt_sigframe_n32 {
|
||||
struct ucontextn32 rs_uc;
|
||||
};
|
||||
|
||||
extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
|
||||
|
||||
asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
|
||||
{
|
||||
compat_sigset_t __user *unewset;
|
||||
compat_sigset_t uset;
|
||||
size_t sigsetsize;
|
||||
sigset_t newset;
|
||||
|
||||
/* XXX Don't preclude handling different sized sigset_t's. */
|
||||
sigsetsize = regs.regs[5];
|
||||
if (sigsetsize != sizeof(sigset_t))
|
||||
return -EINVAL;
|
||||
|
||||
unewset = (compat_sigset_t __user *) regs.regs[4];
|
||||
if (copy_from_user(&uset, unewset, sizeof(uset)))
|
||||
return -EFAULT;
|
||||
sigset_from_compat(&newset, &uset);
|
||||
return sigsuspend(&newset);
|
||||
}
|
||||
|
||||
asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
|
||||
{
|
||||
struct rt_sigframe_n32 __user *frame;
|
||||
mm_segment_t old_fs;
|
||||
sigset_t set;
|
||||
stack_t st;
|
||||
s32 sp;
|
||||
int sig;
|
||||
|
||||
frame = (struct rt_sigframe_n32 __user *) regs.regs[29];
|
||||
@ -117,22 +85,8 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
|
||||
else if (sig)
|
||||
force_sig(sig, current);
|
||||
|
||||
/* The ucontext contains a stack32_t, so we must convert! */
|
||||
if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
|
||||
if (compat_restore_altstack(&frame->rs_uc.uc_stack))
|
||||
goto badframe;
|
||||
st.ss_sp = (void __user *)(long) sp;
|
||||
if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
|
||||
goto badframe;
|
||||
if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
|
||||
goto badframe;
|
||||
|
||||
/* It is more difficult to avoid calling this function than to
|
||||
call it and ignore errors. */
|
||||
old_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]);
|
||||
set_fs(old_fs);
|
||||
|
||||
|
||||
/*
|
||||
* Don't let your children do this ...
|
||||
@ -153,7 +107,6 @@ static int setup_rt_frame_n32(void *sig_return, struct k_sigaction *ka,
|
||||
{
|
||||
struct rt_sigframe_n32 __user *frame;
|
||||
int err = 0;
|
||||
s32 sp;
|
||||
|
||||
frame = get_sigframe(ka, regs, sizeof(*frame));
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
|
||||
@ -165,13 +118,7 @@ static int setup_rt_frame_n32(void *sig_return, struct k_sigaction *ka,
|
||||
/* Create the ucontext. */
|
||||
err |= __put_user(0, &frame->rs_uc.uc_flags);
|
||||
err |= __put_user(0, &frame->rs_uc.uc_link);
|
||||
sp = (int) (long) current->sas_ss_sp;
|
||||
err |= __put_user(sp,
|
||||
&frame->rs_uc.uc_stack.ss_sp);
|
||||
err |= __put_user(sas_ss_flags(regs->regs[29]),
|
||||
&frame->rs_uc.uc_stack.ss_flags);
|
||||
err |= __put_user(current->sas_ss_size,
|
||||
&frame->rs_uc.uc_stack.ss_size);
|
||||
err |= __compat_save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]);
|
||||
err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext);
|
||||
err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set);
|
||||
|
||||
|
@ -46,20 +46,14 @@
|
||||
* argument. Historically that used to be expensive in Linux. These days
|
||||
* the performance advantage is negligible.
|
||||
*/
|
||||
asmlinkage int sysm_pipe(nabi_no_regargs volatile struct pt_regs regs)
|
||||
asmlinkage int sysm_pipe(void)
|
||||
{
|
||||
int fd[2];
|
||||
int error, res;
|
||||
|
||||
error = do_pipe_flags(fd, 0);
|
||||
if (error) {
|
||||
res = error;
|
||||
goto out;
|
||||
}
|
||||
regs.regs[3] = fd[1];
|
||||
res = fd[0];
|
||||
out:
|
||||
return res;
|
||||
int error = do_pipe_flags(fd, 0);
|
||||
if (error)
|
||||
return error;
|
||||
current_pt_regs()->regs[3] = fd[1];
|
||||
return fd[0];
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len,
|
||||
@ -89,43 +83,7 @@ SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
|
||||
}
|
||||
|
||||
save_static_function(sys_fork);
|
||||
static int __used noinline
|
||||
_sys_fork(nabi_no_regargs struct pt_regs regs)
|
||||
{
|
||||
return do_fork(SIGCHLD, regs.regs[29], 0, NULL, NULL);
|
||||
}
|
||||
|
||||
save_static_function(sys_clone);
|
||||
static int __used noinline
|
||||
_sys_clone(nabi_no_regargs struct pt_regs regs)
|
||||
{
|
||||
unsigned long clone_flags;
|
||||
unsigned long newsp;
|
||||
int __user *parent_tidptr, *child_tidptr;
|
||||
|
||||
clone_flags = regs.regs[4];
|
||||
newsp = regs.regs[5];
|
||||
if (!newsp)
|
||||
newsp = regs.regs[29];
|
||||
parent_tidptr = (int __user *) regs.regs[6];
|
||||
#ifdef CONFIG_32BIT
|
||||
/* We need to fetch the fifth argument off the stack. */
|
||||
child_tidptr = NULL;
|
||||
if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) {
|
||||
int __user *__user *usp = (int __user *__user *) regs.regs[29];
|
||||
if (regs.regs[2] == __NR_syscall) {
|
||||
if (get_user (child_tidptr, &usp[5]))
|
||||
return -EFAULT;
|
||||
}
|
||||
else if (get_user (child_tidptr, &usp[4]))
|
||||
return -EFAULT;
|
||||
}
|
||||
#else
|
||||
child_tidptr = (int __user *) regs.regs[8];
|
||||
#endif
|
||||
return do_fork(clone_flags, newsp, 0,
|
||||
parent_tidptr, child_tidptr);
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
|
||||
{
|
||||
@ -138,10 +96,10 @@ SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int mips_atomic_set(struct pt_regs *regs,
|
||||
unsigned long addr, unsigned long new)
|
||||
static inline int mips_atomic_set(unsigned long addr, unsigned long new)
|
||||
{
|
||||
unsigned long old, tmp;
|
||||
struct pt_regs *regs;
|
||||
unsigned int err;
|
||||
|
||||
if (unlikely(addr & 3))
|
||||
@ -222,6 +180,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
|
||||
if (unlikely(err))
|
||||
return err;
|
||||
|
||||
regs = current_pt_regs();
|
||||
regs->regs[2] = old;
|
||||
regs->regs[7] = 0; /* No error */
|
||||
|
||||
@ -235,22 +194,14 @@ static inline int mips_atomic_set(struct pt_regs *regs,
|
||||
: "r" (regs));
|
||||
|
||||
/* unreached. Honestly. */
|
||||
while (1);
|
||||
unreachable();
|
||||
}
|
||||
|
||||
save_static_function(sys_sysmips);
|
||||
static int __used noinline
|
||||
_sys_sysmips(nabi_no_regargs struct pt_regs regs)
|
||||
SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2)
|
||||
{
|
||||
long cmd, arg1, arg2;
|
||||
|
||||
cmd = regs.regs[4];
|
||||
arg1 = regs.regs[5];
|
||||
arg2 = regs.regs[6];
|
||||
|
||||
switch (cmd) {
|
||||
case MIPS_ATOMIC_SET:
|
||||
return mips_atomic_set(®s, arg1, arg2);
|
||||
return mips_atomic_set(arg1, arg2);
|
||||
|
||||
case MIPS_FIXADE:
|
||||
if (arg1 & ~3)
|
||||
|
@ -10,6 +10,9 @@ config MN10300
|
||||
select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
select OLD_SIGSUSPEND3
|
||||
select OLD_SIGACTION
|
||||
|
||||
config AM33_2
|
||||
def_bool n
|
||||
|
@ -26,13 +26,6 @@ typedef struct {
|
||||
unsigned long sig[_NSIG_WORDS];
|
||||
} sigset_t;
|
||||
|
||||
struct old_sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
old_sigset_t sa_mask;
|
||||
unsigned long sa_flags;
|
||||
__sigrestore_t sa_restorer;
|
||||
};
|
||||
|
||||
#define __ARCH_HAS_SA_RESTORER
|
||||
|
||||
#include <asm/sigcontext.h>
|
||||
|
@ -31,59 +31,6 @@
|
||||
|
||||
#define DEBUG_SIG 0
|
||||
|
||||
/*
|
||||
* atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
asmlinkage long sys_sigsuspend(int history0, int history1, old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
/*
|
||||
* set signal action syscall
|
||||
*/
|
||||
asmlinkage long sys_sigaction(int sig,
|
||||
const struct old_sigaction __user *act,
|
||||
struct old_sigaction __user *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
if (act) {
|
||||
old_sigset_t mask;
|
||||
if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
|
||||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* set alternate signal stack syscall
|
||||
*/
|
||||
asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t *uoss)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, current_frame()->sp);
|
||||
}
|
||||
|
||||
/*
|
||||
* do a signal return; undo the signal stack.
|
||||
*/
|
||||
@ -193,8 +140,7 @@ asmlinkage long sys_rt_sigreturn(void)
|
||||
if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0))
|
||||
goto badframe;
|
||||
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, current_frame()->sp) ==
|
||||
-EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return d0;
|
||||
@ -359,9 +305,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
||||
/* create the ucontext. */
|
||||
if (__put_user(0, &frame->uc.uc_flags) ||
|
||||
__put_user(0, &frame->uc.uc_link) ||
|
||||
__put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) ||
|
||||
__put_user(sas_ss_flags(regs->sp), &frame->uc.uc_stack.ss_flags) ||
|
||||
__put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size) ||
|
||||
__save_altstack(&frame->uc.uc_stack, regs->sp) ||
|
||||
setup_sigcontext(&frame->uc.uc_mcontext,
|
||||
&frame->fpuctx, regs, set->sig[0]) ||
|
||||
__copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)))
|
||||
|
@ -22,6 +22,7 @@ config OPENRISC
|
||||
select GENERIC_STRNCPY_FROM_USER
|
||||
select GENERIC_STRNLEN_USER
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
|
||||
config MMU
|
||||
def_bool y
|
||||
|
@ -1083,10 +1083,6 @@ ENTRY(__sys_fork)
|
||||
l.j _fork_save_extra_regs_and_call
|
||||
l.addi r3,r1,0
|
||||
|
||||
ENTRY(sys_sigaltstack)
|
||||
l.j _sys_sigaltstack
|
||||
l.addi r5,r1,0
|
||||
|
||||
ENTRY(sys_rt_sigreturn)
|
||||
l.j _sys_rt_sigreturn
|
||||
l.addi r3,r1,0
|
||||
|
@ -33,12 +33,6 @@
|
||||
|
||||
#define DEBUG_SIG 0
|
||||
|
||||
asmlinkage long
|
||||
_sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, regs->sp);
|
||||
}
|
||||
|
||||
struct rt_sigframe {
|
||||
struct siginfo *pinfo;
|
||||
void *puc;
|
||||
@ -103,9 +97,7 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs)
|
||||
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
|
||||
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->sp) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
|
||||
return regs->gpr[11];
|
||||
@ -205,10 +197,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
||||
err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));
|
||||
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->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->sp);
|
||||
err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
|
||||
|
||||
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
|
@ -23,6 +23,11 @@ config PARISC
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select MODULES_USE_ELF_RELA
|
||||
select CLONE_BACKWARDS
|
||||
select GENERIC_SIGALTSTACK
|
||||
select GENERIC_COMPAT_RT_SIGACTION
|
||||
select GENERIC_COMPAT_RT_SIGQUEUEINFO
|
||||
select GENERIC_COMPAT_RT_SIGPROCMASK
|
||||
select GENERIC_COMPAT_RT_SIGPENDING
|
||||
|
||||
help
|
||||
The PA-RISC microprocessor is designed by Hewlett-Packard and used
|
||||
|
@ -1748,44 +1748,6 @@ ENTRY(sys_rt_sigreturn_wrapper)
|
||||
LDREG PT_GR28(%r1),%r28 /* reload original r28 for syscall_exit */
|
||||
ENDPROC(sys_rt_sigreturn_wrapper)
|
||||
|
||||
ENTRY(sys_sigaltstack_wrapper)
|
||||
/* Get the user stack pointer */
|
||||
LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
|
||||
ldo TASK_REGS(%r1),%r24 /* get pt regs */
|
||||
LDREG TASK_PT_GR30(%r24),%r24
|
||||
STREG %r2, -RP_OFFSET(%r30)
|
||||
#ifdef CONFIG_64BIT
|
||||
ldo FRAME_SIZE(%r30), %r30
|
||||
BL do_sigaltstack,%r2
|
||||
ldo -16(%r30),%r29 /* Reference param save area */
|
||||
#else
|
||||
BL do_sigaltstack,%r2
|
||||
ldo FRAME_SIZE(%r30), %r30
|
||||
#endif
|
||||
|
||||
ldo -FRAME_SIZE(%r30), %r30
|
||||
LDREG -RP_OFFSET(%r30), %r2
|
||||
bv %r0(%r2)
|
||||
nop
|
||||
ENDPROC(sys_sigaltstack_wrapper)
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
ENTRY(sys32_sigaltstack_wrapper)
|
||||
/* Get the user stack pointer */
|
||||
LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r24
|
||||
LDREG TASK_PT_GR30(%r24),%r24
|
||||
STREG %r2, -RP_OFFSET(%r30)
|
||||
ldo FRAME_SIZE(%r30), %r30
|
||||
BL do_sigaltstack32,%r2
|
||||
ldo -16(%r30),%r29 /* Reference param save area */
|
||||
|
||||
ldo -FRAME_SIZE(%r30), %r30
|
||||
LDREG -RP_OFFSET(%r30), %r2
|
||||
bv %r0(%r2)
|
||||
nop
|
||||
ENDPROC(sys32_sigaltstack_wrapper)
|
||||
#endif
|
||||
|
||||
ENTRY(syscall_exit)
|
||||
/* NOTE: HP-UX syscalls also come through here
|
||||
* after hpux_syscall_exit fixes up return
|
||||
|
@ -143,7 +143,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
|
||||
goto give_sigsegv;
|
||||
DBG(1,"sys_rt_sigreturn: usp %#08lx stack 0x%p\n",
|
||||
usp, &compat_frame->uc.uc_stack);
|
||||
if (do_sigaltstack32(&compat_frame->uc.uc_stack, NULL, usp) == -EFAULT)
|
||||
if (compat_restore_altstack(&compat_frame->uc.uc_stack))
|
||||
goto give_sigsegv;
|
||||
} else
|
||||
#endif
|
||||
@ -154,7 +154,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
|
||||
goto give_sigsegv;
|
||||
DBG(1,"sys_rt_sigreturn: usp %#08lx stack 0x%p\n",
|
||||
usp, &frame->uc.uc_stack);
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL, usp) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto give_sigsegv;
|
||||
}
|
||||
|
||||
@ -260,15 +260,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
||||
if (is_compat_task()) {
|
||||
DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &compat_frame->info);
|
||||
err |= copy_siginfo_to_user32(&compat_frame->info, info);
|
||||
DBG(1,"SETUP_RT_FRAME: 1\n");
|
||||
compat_val = (compat_int_t)current->sas_ss_sp;
|
||||
err |= __put_user(compat_val, &compat_frame->uc.uc_stack.ss_sp);
|
||||
DBG(1,"SETUP_RT_FRAME: 2\n");
|
||||
compat_val = (compat_int_t)current->sas_ss_size;
|
||||
err |= __put_user(compat_val, &compat_frame->uc.uc_stack.ss_size);
|
||||
DBG(1,"SETUP_RT_FRAME: 3\n");
|
||||
compat_val = sas_ss_flags(regs->gr[30]);
|
||||
err |= __put_user(compat_val, &compat_frame->uc.uc_stack.ss_flags);
|
||||
err |= __compat_save_altstack( &compat_frame->uc.uc_stack, regs->gr[30]);
|
||||
DBG(1,"setup_rt_frame: frame->uc = 0x%p\n", &compat_frame->uc);
|
||||
DBG(1,"setup_rt_frame: frame->uc.uc_mcontext = 0x%p\n", &compat_frame->uc.uc_mcontext);
|
||||
err |= setup_sigcontext32(&compat_frame->uc.uc_mcontext,
|
||||
@ -280,10 +272,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
||||
{
|
||||
DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &frame->info);
|
||||
err |= copy_siginfo_to_user(&frame->info, info);
|
||||
err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
|
||||
err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
|
||||
err |= __put_user(sas_ss_flags(regs->gr[30]),
|
||||
&frame->uc.uc_stack.ss_flags);
|
||||
err |= __save_altstack(&frame->uc.uc_stack, regs->gr[30]);
|
||||
DBG(1,"setup_rt_frame: frame->uc = 0x%p\n", &frame->uc);
|
||||
DBG(1,"setup_rt_frame: frame->uc.uc_mcontext = 0x%p\n", &frame->uc.uc_mcontext);
|
||||
err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, in_syscall);
|
||||
|
@ -60,129 +60,6 @@ sigset_64to32(compat_sigset_t *s32, sigset_t *s64)
|
||||
s32->sig[1] = (s64->sig[0] >> 32) & 0xffffffffUL;
|
||||
}
|
||||
|
||||
static int
|
||||
put_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
|
||||
{
|
||||
compat_sigset_t s;
|
||||
|
||||
if (sz != sizeof *set)
|
||||
return -EINVAL;
|
||||
sigset_64to32(&s, set);
|
||||
|
||||
return copy_to_user(up, &s, sizeof s);
|
||||
}
|
||||
|
||||
static int
|
||||
get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
|
||||
{
|
||||
compat_sigset_t s;
|
||||
int r;
|
||||
|
||||
if (sz != sizeof *set)
|
||||
return -EINVAL;
|
||||
|
||||
if ((r = copy_from_user(&s, up, sz)) == 0) {
|
||||
sigset_32to64(set, &s);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, compat_sigset_t __user *oset,
|
||||
unsigned int sigsetsize)
|
||||
{
|
||||
sigset_t old_set, new_set;
|
||||
int ret;
|
||||
|
||||
if (set && get_sigset32(set, &new_set, sigsetsize))
|
||||
return -EFAULT;
|
||||
|
||||
KERNEL_SYSCALL(ret, sys_rt_sigprocmask, how, set ? (sigset_t __user *)&new_set : NULL,
|
||||
oset ? (sigset_t __user *)&old_set : NULL, sigsetsize);
|
||||
|
||||
if (!ret && oset && put_sigset32(oset, &old_set, sigsetsize))
|
||||
return -EFAULT;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int sys32_rt_sigpending(compat_sigset_t __user *uset, unsigned int sigsetsize)
|
||||
{
|
||||
int ret;
|
||||
sigset_t set;
|
||||
|
||||
KERNEL_SYSCALL(ret, sys_rt_sigpending, (sigset_t __user *)&set, sigsetsize);
|
||||
|
||||
if (!ret && put_sigset32(uset, &set, sigsetsize))
|
||||
return -EFAULT;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
long
|
||||
sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, struct sigaction32 __user *oact,
|
||||
size_t sigsetsize)
|
||||
{
|
||||
struct k_sigaction32 new_sa32, old_sa32;
|
||||
struct k_sigaction new_sa, old_sa;
|
||||
int ret = -EINVAL;
|
||||
|
||||
if (act) {
|
||||
if (copy_from_user(&new_sa32.sa, act, sizeof new_sa32.sa))
|
||||
return -EFAULT;
|
||||
new_sa.sa.sa_handler = (__sighandler_t)(unsigned long)new_sa32.sa.sa_handler;
|
||||
new_sa.sa.sa_flags = new_sa32.sa.sa_flags;
|
||||
sigset_32to64(&new_sa.sa.sa_mask, &new_sa32.sa.sa_mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
sigset_64to32(&old_sa32.sa.sa_mask, &old_sa.sa.sa_mask);
|
||||
old_sa32.sa.sa_flags = old_sa.sa.sa_flags;
|
||||
old_sa32.sa.sa_handler = (__sighandler_t32)(unsigned long)old_sa.sa.sa_handler;
|
||||
if (copy_to_user(oact, &old_sa32.sa, sizeof old_sa32.sa))
|
||||
return -EFAULT;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
do_sigaltstack32 (const compat_stack_t __user *uss32, compat_stack_t __user *uoss32, unsigned long sp)
|
||||
{
|
||||
compat_stack_t ss32, oss32;
|
||||
stack_t ss, oss;
|
||||
stack_t *ssp = NULL, *ossp = NULL;
|
||||
int ret;
|
||||
|
||||
if (uss32) {
|
||||
if (copy_from_user(&ss32, uss32, sizeof ss32))
|
||||
return -EFAULT;
|
||||
|
||||
ss.ss_sp = (void __user *)(unsigned long)ss32.ss_sp;
|
||||
ss.ss_flags = ss32.ss_flags;
|
||||
ss.ss_size = ss32.ss_size;
|
||||
|
||||
ssp = &ss;
|
||||
}
|
||||
|
||||
if (uoss32)
|
||||
ossp = &oss;
|
||||
|
||||
KERNEL_SYSCALL(ret, do_sigaltstack, (const stack_t __user *)ssp, (stack_t __user *)ossp, sp);
|
||||
|
||||
if (!ret && uoss32) {
|
||||
oss32.ss_sp = (unsigned int)(unsigned long)oss.ss_sp;
|
||||
oss32.ss_flags = oss.ss_flags;
|
||||
oss32.ss_size = oss.ss_size;
|
||||
if (copy_to_user(uoss32, &oss32, sizeof *uoss32))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
long
|
||||
restore_sigcontext32(struct compat_sigcontext __user *sc, struct compat_regfile __user * rf,
|
||||
struct pt_regs *regs)
|
||||
@ -499,22 +376,3 @@ copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from)
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_rt_sigqueueinfo(int pid, int sig,
|
||||
struct compat_siginfo __user *uinfo)
|
||||
{
|
||||
siginfo_t info;
|
||||
|
||||
if (copy_siginfo_from_user32(&info, uinfo))
|
||||
return -EFAULT;
|
||||
|
||||
/* Not even root can pretend to send signals from the kernel.
|
||||
Nor can they impersonate a kill(), which adds source info. */
|
||||
if (info.si_code >= 0)
|
||||
return -EPERM;
|
||||
info.si_signo = sig;
|
||||
|
||||
/* POSIX.1b doesn't mention process groups. */
|
||||
return kill_proc_info(sig, &info, pid);
|
||||
}
|
||||
|
||||
|
@ -21,23 +21,6 @@
|
||||
|
||||
#include <linux/compat.h>
|
||||
|
||||
typedef compat_uptr_t compat_sighandler_t;
|
||||
|
||||
typedef struct compat_sigaltstack {
|
||||
compat_uptr_t ss_sp;
|
||||
compat_int_t ss_flags;
|
||||
compat_size_t ss_size;
|
||||
} compat_stack_t;
|
||||
|
||||
/* Most things should be clean enough to redefine this at will, if care
|
||||
is taken to make libc match. */
|
||||
|
||||
struct compat_sigaction {
|
||||
compat_sighandler_t sa_handler;
|
||||
compat_uint_t sa_flags;
|
||||
compat_sigset_t sa_mask; /* mask last for extensibility */
|
||||
};
|
||||
|
||||
/* 32-bit ucontext as seen from an 64-bit kernel */
|
||||
struct compat_ucontext {
|
||||
compat_uint_t uc_flags;
|
||||
@ -51,10 +34,6 @@ struct compat_ucontext {
|
||||
|
||||
/* ELF32 signal handling */
|
||||
|
||||
struct k_sigaction32 {
|
||||
struct compat_sigaction sa;
|
||||
};
|
||||
|
||||
int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from);
|
||||
int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from);
|
||||
|
||||
@ -102,8 +81,6 @@ struct compat_rt_sigframe {
|
||||
|
||||
void sigset_32to64(sigset_t *s64, compat_sigset_t *s32);
|
||||
void sigset_64to32(compat_sigset_t *s32, sigset_t *s64);
|
||||
int do_sigaltstack32 (const compat_stack_t __user *uss32,
|
||||
compat_stack_t __user *uoss32, unsigned long sp);
|
||||
long restore_sigcontext32(struct compat_sigcontext __user *sc,
|
||||
struct compat_regfile __user *rf,
|
||||
struct pt_regs *regs);
|
||||
|
@ -33,16 +33,4 @@
|
||||
set_fs (old_fs); \
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
typedef __u32 __sighandler_t32;
|
||||
|
||||
struct sigaction32 {
|
||||
__sighandler_t32 sa_handler;
|
||||
unsigned int sa_flags;
|
||||
compat_sigset_t sa_mask; /* mask last for extensibility */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -61,18 +61,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
|
||||
struct compat_timespec __user *interval)
|
||||
{
|
||||
struct timespec t;
|
||||
int ret;
|
||||
|
||||
KERNEL_SYSCALL(ret, sys_sched_rr_get_interval, pid, (struct timespec __user *)&t);
|
||||
if (put_compat_timespec(&t, interval))
|
||||
return -EFAULT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct msgbuf32 {
|
||||
int mtype;
|
||||
char mtext[1];
|
||||
|
@ -250,12 +250,12 @@
|
||||
/* These 2 would've worked if someone had defined struct timespec
|
||||
* carefully, like timeval for example (which is about the same).
|
||||
* Unfortunately it contains a long :-( */
|
||||
ENTRY_DIFF(sched_rr_get_interval)
|
||||
ENTRY_COMP(sched_rr_get_interval)
|
||||
ENTRY_COMP(nanosleep)
|
||||
ENTRY_SAME(mremap)
|
||||
ENTRY_SAME(setresuid)
|
||||
ENTRY_SAME(getresuid) /* 165 */
|
||||
ENTRY_DIFF(sigaltstack_wrapper)
|
||||
ENTRY_COMP(sigaltstack)
|
||||
ENTRY_SAME(ni_syscall) /* query_module */
|
||||
ENTRY_SAME(poll)
|
||||
/* structs contain pointers and an in_addr... */
|
||||
@ -265,9 +265,9 @@
|
||||
ENTRY_SAME(prctl)
|
||||
/* signals need a careful review */
|
||||
ENTRY_SAME(rt_sigreturn_wrapper)
|
||||
ENTRY_DIFF(rt_sigaction)
|
||||
ENTRY_DIFF(rt_sigprocmask) /* 175 */
|
||||
ENTRY_DIFF(rt_sigpending)
|
||||
ENTRY_COMP(rt_sigaction)
|
||||
ENTRY_COMP(rt_sigprocmask) /* 175 */
|
||||
ENTRY_COMP(rt_sigpending)
|
||||
ENTRY_COMP(rt_sigtimedwait)
|
||||
/* even though the struct siginfo_t is different, it appears like
|
||||
* all the paths use values which should be same wide and narrow.
|
||||
|
@ -144,6 +144,13 @@ config PPC
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select MODULES_USE_ELF_RELA
|
||||
select CLONE_BACKWARDS
|
||||
select GENERIC_SIGALTSTACK
|
||||
select GENERIC_COMPAT_RT_SIGACTION
|
||||
select GENERIC_COMPAT_RT_SIGQUEUEINFO
|
||||
select GENERIC_COMPAT_RT_SIGPROCMASK
|
||||
select GENERIC_COMPAT_RT_SIGPENDING
|
||||
select OLD_SIGSUSPEND
|
||||
select OLD_SIGACTION if PPC32
|
||||
|
||||
config EARLY_PRINTK
|
||||
bool
|
||||
@ -154,6 +161,7 @@ config COMPAT
|
||||
default y if PPC64
|
||||
select COMPAT_BINFMT_ELF
|
||||
select ARCH_WANT_OLD_COMPAT_IPC
|
||||
select COMPAT_OLD_SIGACTION
|
||||
|
||||
config SYSVIPC_COMPAT
|
||||
bool
|
||||
|
@ -5,9 +5,7 @@
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/signal.h>
|
||||
|
||||
struct pt_regs;
|
||||
struct rtas_args;
|
||||
|
||||
asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
|
||||
@ -16,15 +14,8 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
|
||||
asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len,
|
||||
unsigned long prot, unsigned long flags,
|
||||
unsigned long fd, unsigned long pgoff);
|
||||
asmlinkage long sys_pipe(int __user *fildes);
|
||||
asmlinkage long sys_pipe2(int __user *fildes, int flags);
|
||||
asmlinkage long ppc64_personality(unsigned long personality);
|
||||
asmlinkage int ppc_rtas(struct rtas_args __user *uargs);
|
||||
asmlinkage time_t sys64_time(time_t __user * tloc);
|
||||
|
||||
asmlinkage long sys_sigaltstack(const stack_t __user *uss,
|
||||
stack_t __user *uoss, unsigned long r5, unsigned long r6,
|
||||
unsigned long r7, unsigned long r8, struct pt_regs *regs);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __ASM_POWERPC_SYSCALLS_H */
|
||||
|
@ -10,8 +10,8 @@ SYSCALL_SPU(read)
|
||||
SYSCALL_SPU(write)
|
||||
COMPAT_SYS_SPU(open)
|
||||
SYSCALL_SPU(close)
|
||||
COMPAT_SYS_SPU(waitpid)
|
||||
COMPAT_SYS_SPU(creat)
|
||||
SYSCALL_SPU(waitpid)
|
||||
SYSCALL_SPU(creat)
|
||||
SYSCALL_SPU(link)
|
||||
SYSCALL_SPU(unlink)
|
||||
COMPAT_SYS(execve)
|
||||
@ -36,13 +36,13 @@ SYSCALL(pause)
|
||||
COMPAT_SYS(utime)
|
||||
SYSCALL(ni_syscall)
|
||||
SYSCALL(ni_syscall)
|
||||
COMPAT_SYS_SPU(access)
|
||||
COMPAT_SYS_SPU(nice)
|
||||
SYSCALL_SPU(access)
|
||||
SYSCALL_SPU(nice)
|
||||
SYSCALL(ni_syscall)
|
||||
SYSCALL_SPU(sync)
|
||||
COMPAT_SYS_SPU(kill)
|
||||
SYSCALL_SPU(kill)
|
||||
SYSCALL_SPU(rename)
|
||||
COMPAT_SYS_SPU(mkdir)
|
||||
SYSCALL_SPU(mkdir)
|
||||
SYSCALL_SPU(rmdir)
|
||||
SYSCALL_SPU(dup)
|
||||
SYSCALL_SPU(pipe)
|
||||
@ -60,10 +60,10 @@ SYSCALL(ni_syscall)
|
||||
COMPAT_SYS_SPU(ioctl)
|
||||
COMPAT_SYS_SPU(fcntl)
|
||||
SYSCALL(ni_syscall)
|
||||
COMPAT_SYS_SPU(setpgid)
|
||||
SYSCALL_SPU(setpgid)
|
||||
SYSCALL(ni_syscall)
|
||||
SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
|
||||
COMPAT_SYS_SPU(umask)
|
||||
SYSCALL_SPU(umask)
|
||||
SYSCALL_SPU(chroot)
|
||||
COMPAT_SYS(ustat)
|
||||
SYSCALL_SPU(dup2)
|
||||
@ -72,23 +72,24 @@ SYSCALL_SPU(getpgrp)
|
||||
SYSCALL_SPU(setsid)
|
||||
SYS32ONLY(sigaction)
|
||||
SYSCALL_SPU(sgetmask)
|
||||
COMPAT_SYS_SPU(ssetmask)
|
||||
SYSCALL_SPU(ssetmask)
|
||||
SYSCALL_SPU(setreuid)
|
||||
SYSCALL_SPU(setregid)
|
||||
#define compat_sys_sigsuspend sys_sigsuspend
|
||||
SYS32ONLY(sigsuspend)
|
||||
COMPAT_SYS(sigpending)
|
||||
COMPAT_SYS_SPU(sethostname)
|
||||
SYSCALL_SPU(sethostname)
|
||||
COMPAT_SYS_SPU(setrlimit)
|
||||
COMPAT_SYS(old_getrlimit)
|
||||
COMPAT_SYS_SPU(getrusage)
|
||||
COMPAT_SYS_SPU(gettimeofday)
|
||||
COMPAT_SYS_SPU(settimeofday)
|
||||
COMPAT_SYS_SPU(getgroups)
|
||||
COMPAT_SYS_SPU(setgroups)
|
||||
SYSCALL_SPU(getgroups)
|
||||
SYSCALL_SPU(setgroups)
|
||||
SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select)
|
||||
SYSCALL_SPU(symlink)
|
||||
OLDSYS(lstat)
|
||||
COMPAT_SYS_SPU(readlink)
|
||||
SYSCALL_SPU(readlink)
|
||||
SYSCALL(uselib)
|
||||
SYSCALL(swapon)
|
||||
SYSCALL(reboot)
|
||||
@ -99,14 +100,14 @@ COMPAT_SYS_SPU(truncate)
|
||||
COMPAT_SYS_SPU(ftruncate)
|
||||
SYSCALL_SPU(fchmod)
|
||||
SYSCALL_SPU(fchown)
|
||||
COMPAT_SYS_SPU(getpriority)
|
||||
COMPAT_SYS_SPU(setpriority)
|
||||
SYSCALL_SPU(getpriority)
|
||||
SYSCALL_SPU(setpriority)
|
||||
SYSCALL(ni_syscall)
|
||||
COMPAT_SYS(statfs)
|
||||
COMPAT_SYS(fstatfs)
|
||||
SYSCALL(ni_syscall)
|
||||
COMPAT_SYS_SPU(socketcall)
|
||||
COMPAT_SYS_SPU(syslog)
|
||||
SYSCALL_SPU(syslog)
|
||||
COMPAT_SYS_SPU(setitimer)
|
||||
COMPAT_SYS_SPU(getitimer)
|
||||
COMPAT_SYS_SPU(newstat)
|
||||
@ -124,7 +125,7 @@ COMPAT_SYS(ipc)
|
||||
SYSCALL_SPU(fsync)
|
||||
SYS32ONLY(sigreturn)
|
||||
PPC_SYS(clone)
|
||||
COMPAT_SYS_SPU(setdomainname)
|
||||
SYSCALL_SPU(setdomainname)
|
||||
SYSCALL_SPU(newuname)
|
||||
SYSCALL(ni_syscall)
|
||||
COMPAT_SYS_SPU(adjtimex)
|
||||
@ -135,10 +136,10 @@ SYSCALL(init_module)
|
||||
SYSCALL(delete_module)
|
||||
SYSCALL(ni_syscall)
|
||||
SYSCALL(quotactl)
|
||||
COMPAT_SYS_SPU(getpgid)
|
||||
SYSCALL_SPU(getpgid)
|
||||
SYSCALL_SPU(fchdir)
|
||||
SYSCALL_SPU(bdflush)
|
||||
COMPAT_SYS(sysfs)
|
||||
SYSCALL_SPU(sysfs)
|
||||
SYSX_SPU(ppc64_personality,ppc64_personality,sys_personality)
|
||||
SYSCALL(ni_syscall)
|
||||
SYSCALL_SPU(setfsuid)
|
||||
@ -150,21 +151,21 @@ SYSCALL_SPU(flock)
|
||||
SYSCALL_SPU(msync)
|
||||
COMPAT_SYS_SPU(readv)
|
||||
COMPAT_SYS_SPU(writev)
|
||||
COMPAT_SYS_SPU(getsid)
|
||||
SYSCALL_SPU(getsid)
|
||||
SYSCALL_SPU(fdatasync)
|
||||
COMPAT_SYS(sysctl)
|
||||
SYSCALL_SPU(mlock)
|
||||
SYSCALL_SPU(munlock)
|
||||
SYSCALL_SPU(mlockall)
|
||||
SYSCALL_SPU(munlockall)
|
||||
COMPAT_SYS_SPU(sched_setparam)
|
||||
COMPAT_SYS_SPU(sched_getparam)
|
||||
COMPAT_SYS_SPU(sched_setscheduler)
|
||||
COMPAT_SYS_SPU(sched_getscheduler)
|
||||
SYSCALL_SPU(sched_setparam)
|
||||
SYSCALL_SPU(sched_getparam)
|
||||
SYSCALL_SPU(sched_setscheduler)
|
||||
SYSCALL_SPU(sched_getscheduler)
|
||||
SYSCALL_SPU(sched_yield)
|
||||
COMPAT_SYS_SPU(sched_get_priority_max)
|
||||
COMPAT_SYS_SPU(sched_get_priority_min)
|
||||
SYSX_SPU(sys_sched_rr_get_interval,compat_sys_sched_rr_get_interval_wrapper,sys_sched_rr_get_interval)
|
||||
SYSCALL_SPU(sched_get_priority_max)
|
||||
SYSCALL_SPU(sched_get_priority_min)
|
||||
COMPAT_SYS_SPU(sched_rr_get_interval)
|
||||
COMPAT_SYS_SPU(nanosleep)
|
||||
SYSCALL_SPU(mremap)
|
||||
SYSCALL_SPU(setresuid)
|
||||
@ -174,7 +175,7 @@ SYSCALL_SPU(poll)
|
||||
SYSCALL(ni_syscall)
|
||||
SYSCALL_SPU(setresgid)
|
||||
SYSCALL_SPU(getresgid)
|
||||
COMPAT_SYS_SPU(prctl)
|
||||
SYSCALL_SPU(prctl)
|
||||
COMPAT_SYS(rt_sigreturn)
|
||||
COMPAT_SYS(rt_sigaction)
|
||||
COMPAT_SYS(rt_sigprocmask)
|
||||
@ -253,7 +254,7 @@ COMPAT_SYS_SPU(clock_gettime)
|
||||
COMPAT_SYS_SPU(clock_getres)
|
||||
COMPAT_SYS_SPU(clock_nanosleep)
|
||||
SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
|
||||
COMPAT_SYS_SPU(tgkill)
|
||||
SYSCALL_SPU(tgkill)
|
||||
COMPAT_SYS_SPU(utimes)
|
||||
COMPAT_SYS_SPU(statfs64)
|
||||
COMPAT_SYS_SPU(fstatfs64)
|
||||
@ -276,8 +277,8 @@ COMPAT_SYS(add_key)
|
||||
COMPAT_SYS(request_key)
|
||||
COMPAT_SYS(keyctl)
|
||||
COMPAT_SYS(waitid)
|
||||
COMPAT_SYS(ioprio_set)
|
||||
COMPAT_SYS(ioprio_get)
|
||||
SYSCALL(ioprio_set)
|
||||
SYSCALL(ioprio_get)
|
||||
SYSCALL(inotify_init)
|
||||
SYSCALL(inotify_add_watch)
|
||||
SYSCALL(inotify_rm_watch)
|
||||
|
@ -90,6 +90,7 @@ typedef struct {
|
||||
|
||||
#include <asm-generic/signal-defs.h>
|
||||
|
||||
#ifndef __KERNEL__
|
||||
struct old_sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
old_sigset_t sa_mask;
|
||||
@ -97,7 +98,6 @@ struct old_sigaction {
|
||||
__sigrestore_t sa_restorer;
|
||||
};
|
||||
|
||||
#ifndef __KERNEL__
|
||||
struct sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
unsigned long sa_flags;
|
||||
|
@ -16,30 +16,6 @@
|
||||
|
||||
/* These are here to support 32-bit syscalls on a 64-bit kernel. */
|
||||
|
||||
#define __old_sigaction32 old_sigaction32
|
||||
|
||||
struct __old_sigaction32 {
|
||||
compat_uptr_t sa_handler;
|
||||
compat_old_sigset_t sa_mask;
|
||||
unsigned int sa_flags;
|
||||
compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct sigaction32 {
|
||||
compat_uptr_t sa_handler; /* Really a pointer, but need to deal with 32 bits */
|
||||
unsigned int sa_flags;
|
||||
compat_uptr_t sa_restorer; /* Another 32 bit pointer */
|
||||
compat_sigset_t sa_mask; /* A 32 bit mask */
|
||||
};
|
||||
|
||||
typedef struct sigaltstack_32 {
|
||||
unsigned int ss_sp;
|
||||
int ss_flags;
|
||||
compat_size_t ss_size;
|
||||
} stack_32_t;
|
||||
|
||||
struct pt_regs32 {
|
||||
unsigned int gpr[32];
|
||||
unsigned int nip;
|
||||
@ -75,7 +51,7 @@ struct mcontext32 {
|
||||
struct ucontext32 {
|
||||
unsigned int uc_flags;
|
||||
unsigned int uc_link;
|
||||
stack_32_t uc_stack;
|
||||
compat_stack_t uc_stack;
|
||||
int uc_pad[7];
|
||||
compat_uptr_t uc_regs; /* points to uc_mcontext field */
|
||||
compat_sigset_t uc_sigmask; /* mask last for extensibility */
|
||||
|
@ -169,10 +169,3 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
|
||||
tracehook_notify_resume(regs);
|
||||
}
|
||||
}
|
||||
|
||||
long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
|
||||
unsigned long r5, unsigned long r6, unsigned long r7,
|
||||
unsigned long r8, struct pt_regs *regs)
|
||||
{
|
||||
return do_sigaltstack(uss, uoss, regs->gpr[1]);
|
||||
}
|
||||
|
@ -56,9 +56,7 @@
|
||||
#undef DEBUG_SIG
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
#define sys_sigsuspend compat_sys_sigsuspend
|
||||
#define sys_rt_sigreturn compat_sys_rt_sigreturn
|
||||
#define sys_sigaction compat_sys_sigaction
|
||||
#define sys_swapcontext compat_sys_swapcontext
|
||||
#define sys_sigreturn compat_sys_sigreturn
|
||||
|
||||
@ -67,6 +65,8 @@
|
||||
#define mcontext mcontext32
|
||||
#define ucontext ucontext32
|
||||
|
||||
#define __save_altstack __compat_save_altstack
|
||||
|
||||
/*
|
||||
* Userspace code may pass a ucontext which doesn't include VSX added
|
||||
* at the end. We need to check for this case.
|
||||
@ -129,23 +129,6 @@ static inline int get_sigset_t(sigset_t *set,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int get_old_sigaction(struct k_sigaction *new_ka,
|
||||
struct old_sigaction __user *act)
|
||||
{
|
||||
compat_old_sigset_t mask;
|
||||
compat_uptr_t handler, restorer;
|
||||
|
||||
if (get_user(handler, &act->sa_handler) ||
|
||||
__get_user(restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka->sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
new_ka->sa.sa_handler = compat_ptr(handler);
|
||||
new_ka->sa.sa_restorer = compat_ptr(restorer);
|
||||
siginitset(&new_ka->sa.sa_mask, mask);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define to_user_ptr(p) ptr_to_compat(p)
|
||||
#define from_user_ptr(p) compat_ptr(p)
|
||||
|
||||
@ -195,21 +178,6 @@ static inline int get_sigset_t(sigset_t *set, const sigset_t __user *uset)
|
||||
return copy_from_user(set, uset, sizeof(*uset));
|
||||
}
|
||||
|
||||
static inline int get_old_sigaction(struct k_sigaction *new_ka,
|
||||
struct old_sigaction __user *act)
|
||||
{
|
||||
old_sigset_t mask;
|
||||
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(new_ka->sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(new_ka->sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka->sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
siginitset(&new_ka->sa.sa_mask, mask);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define to_user_ptr(p) ((unsigned long)(p))
|
||||
#define from_user_ptr(p) ((void __user *)(p))
|
||||
|
||||
@ -233,50 +201,8 @@ static inline int restore_general_regs(struct pt_regs *regs,
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PPC64 */
|
||||
|
||||
/*
|
||||
* Atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
long sys_sigsuspend(old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
long sys_sigaction(int sig, struct old_sigaction __user *act,
|
||||
struct old_sigaction __user *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
if (sig < 0)
|
||||
sig = -sig;
|
||||
#endif
|
||||
|
||||
if (act) {
|
||||
if (get_old_sigaction(&new_ka, act))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
if (!ret && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(to_user_ptr(old_ka.sa.sa_handler),
|
||||
&oact->sa_handler) ||
|
||||
__put_user(to_user_ptr(old_ka.sa.sa_restorer),
|
||||
&oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* When we have signals to deliver, we set up on the
|
||||
* user stack, going down from the original stack pointer:
|
||||
@ -588,89 +514,6 @@ static long restore_user_regs(struct pt_regs *regs,
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
long compat_sys_rt_sigaction(int sig, const struct sigaction32 __user *act,
|
||||
struct sigaction32 __user *oact, size_t sigsetsize)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
/* XXX: Don't preclude handling different sized sigset_t's. */
|
||||
if (sigsetsize != sizeof(compat_sigset_t))
|
||||
return -EINVAL;
|
||||
|
||||
if (act) {
|
||||
compat_uptr_t handler;
|
||||
|
||||
ret = get_user(handler, &act->sa_handler);
|
||||
new_ka.sa.sa_handler = compat_ptr(handler);
|
||||
ret |= get_sigset_t(&new_ka.sa.sa_mask, &act->sa_mask);
|
||||
ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
|
||||
if (ret)
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
if (!ret && oact) {
|
||||
ret = put_user(to_user_ptr(old_ka.sa.sa_handler), &oact->sa_handler);
|
||||
ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask);
|
||||
ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: it is necessary to treat how as an unsigned int, with the
|
||||
* corresponding cast to a signed int to insure that the proper
|
||||
* conversion (sign extension) between the register representation
|
||||
* of a signed int (msr in 32-bit mode) and the register representation
|
||||
* of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
long compat_sys_rt_sigprocmask(u32 how, compat_sigset_t __user *set,
|
||||
compat_sigset_t __user *oset, size_t sigsetsize)
|
||||
{
|
||||
sigset_t s;
|
||||
sigset_t __user *up;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
if (set) {
|
||||
if (get_sigset_t(&s, set))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
/* This is valid because of the set_fs() */
|
||||
up = (sigset_t __user *) &s;
|
||||
ret = sys_rt_sigprocmask((int)how, set ? up : NULL, oset ? up : NULL,
|
||||
sigsetsize);
|
||||
set_fs(old_fs);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (oset) {
|
||||
if (put_sigset_t(oset, &s))
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
long compat_sys_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize)
|
||||
{
|
||||
sigset_t s;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
/* The __user pointer cast is valid because of the set_fs() */
|
||||
ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize);
|
||||
set_fs(old_fs);
|
||||
if (!ret) {
|
||||
if (put_sigset_t(set, &s))
|
||||
return -EFAULT;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s)
|
||||
{
|
||||
int err;
|
||||
@ -739,79 +582,6 @@ int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: it is necessary to treat pid and sig as unsigned ints, with the
|
||||
* corresponding cast to a signed int to insure that the proper conversion
|
||||
* (sign extension) between the register representation of a signed int
|
||||
* (msr in 32-bit mode) and the register representation of a signed int
|
||||
* (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo)
|
||||
{
|
||||
siginfo_t info;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
ret = copy_siginfo_from_user32(&info, uinfo);
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
|
||||
set_fs (KERNEL_DS);
|
||||
/* The __user pointer cast is valid becasuse of the set_fs() */
|
||||
ret = sys_rt_sigqueueinfo((int)pid, (int)sig, (siginfo_t __user *) &info);
|
||||
set_fs (old_fs);
|
||||
return ret;
|
||||
}
|
||||
/*
|
||||
* Start Alternate signal stack support
|
||||
*
|
||||
* System Calls
|
||||
* sigaltatck compat_sys_sigaltstack
|
||||
*/
|
||||
|
||||
int compat_sys_sigaltstack(u32 __new, u32 __old, int r5,
|
||||
int r6, int r7, int r8, struct pt_regs *regs)
|
||||
{
|
||||
stack_32_t __user * newstack = compat_ptr(__new);
|
||||
stack_32_t __user * oldstack = compat_ptr(__old);
|
||||
stack_t uss, uoss;
|
||||
int ret;
|
||||
mm_segment_t old_fs;
|
||||
unsigned long sp;
|
||||
compat_uptr_t ss_sp;
|
||||
|
||||
/*
|
||||
* set sp to the user stack on entry to the system call
|
||||
* the system call router sets R9 to the saved registers
|
||||
*/
|
||||
sp = regs->gpr[1];
|
||||
|
||||
/* Put new stack info in local 64 bit stack struct */
|
||||
if (newstack) {
|
||||
if (get_user(ss_sp, &newstack->ss_sp) ||
|
||||
__get_user(uss.ss_flags, &newstack->ss_flags) ||
|
||||
__get_user(uss.ss_size, &newstack->ss_size))
|
||||
return -EFAULT;
|
||||
uss.ss_sp = compat_ptr(ss_sp);
|
||||
}
|
||||
|
||||
old_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
/* The __user pointer casts are valid because of the set_fs() */
|
||||
ret = do_sigaltstack(
|
||||
newstack ? (stack_t __user *) &uss : NULL,
|
||||
oldstack ? (stack_t __user *) &uoss : NULL,
|
||||
sp);
|
||||
set_fs(old_fs);
|
||||
/* Copy the stack information to the user output buffer */
|
||||
if (!ret && oldstack &&
|
||||
(put_user(ptr_to_compat(uoss.ss_sp), &oldstack->ss_sp) ||
|
||||
__put_user(uoss.ss_flags, &oldstack->ss_flags) ||
|
||||
__put_user(uoss.ss_size, &oldstack->ss_size)))
|
||||
return -EFAULT;
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PPC64 */
|
||||
|
||||
/*
|
||||
@ -838,10 +608,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
|
||||
if (copy_siginfo_to_user(&rt_sf->info, info)
|
||||
|| __put_user(0, &rt_sf->uc.uc_flags)
|
||||
|| __put_user(0, &rt_sf->uc.uc_link)
|
||||
|| __put_user(current->sas_ss_sp, &rt_sf->uc.uc_stack.ss_sp)
|
||||
|| __put_user(sas_ss_flags(regs->gpr[1]),
|
||||
&rt_sf->uc.uc_stack.ss_flags)
|
||||
|| __put_user(current->sas_ss_size, &rt_sf->uc.uc_stack.ss_size)
|
||||
|| __save_altstack(&rt_sf->uc.uc_stack, regs->gpr[1])
|
||||
|| __put_user(to_user_ptr(&rt_sf->uc.uc_mcontext),
|
||||
&rt_sf->uc.uc_regs)
|
||||
|| put_sigset_t(&rt_sf->uc.uc_sigmask, oldset))
|
||||
@ -1038,14 +805,11 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
|
||||
* change it. -- paulus
|
||||
*/
|
||||
#ifdef CONFIG_PPC64
|
||||
/*
|
||||
* We use the compat_sys_ version that does the 32/64 bits conversion
|
||||
* and takes userland pointer directly. What about error checking ?
|
||||
* nobody does any...
|
||||
*/
|
||||
compat_sys_sigaltstack((u32)(u64)&rt_sf->uc.uc_stack, 0, 0, 0, 0, 0, regs);
|
||||
if (compat_restore_altstack(&rt_sf->uc.uc_stack))
|
||||
goto bad;
|
||||
#else
|
||||
do_sigaltstack(&rt_sf->uc.uc_stack, NULL, regs->gpr[1]);
|
||||
if (restore_altstack(&rt_sf->uc.uc_stack))
|
||||
goto bad;
|
||||
#endif
|
||||
set_thread_flag(TIF_RESTOREALL);
|
||||
return 0;
|
||||
@ -1161,7 +925,7 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
|
||||
* always done it up until now so it is probably better not to
|
||||
* change it. -- paulus
|
||||
*/
|
||||
do_sigaltstack(&ctx->uc_stack, NULL, regs->gpr[1]);
|
||||
restore_altstack(&ctx->uc_stack);
|
||||
|
||||
set_thread_flag(TIF_RESTOREALL);
|
||||
out:
|
||||
|
@ -368,10 +368,8 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
|
||||
if (restore_sigcontext(regs, NULL, 1, &uc->uc_mcontext))
|
||||
goto badframe;
|
||||
|
||||
/* do_sigaltstack expects a __user pointer and won't modify
|
||||
* what's in there anyway
|
||||
*/
|
||||
do_sigaltstack(&uc->uc_stack, NULL, regs->gpr[1]);
|
||||
if (restore_altstack(&uc->uc_stack))
|
||||
goto badframe;
|
||||
|
||||
set_thread_flag(TIF_RESTOREALL);
|
||||
return 0;
|
||||
@ -416,10 +414,7 @@ int handle_rt_signal64(int signr, 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(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
|
||||
err |= __put_user(sas_ss_flags(regs->gpr[1]),
|
||||
&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->gpr[1]);
|
||||
err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, signr, NULL,
|
||||
(unsigned long)ka->sa.sa_handler, 1);
|
||||
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
|
@ -61,16 +61,6 @@ asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp,
|
||||
return compat_sys_select((int)n, inp, outp, exp, compat_ptr(tvp_x));
|
||||
}
|
||||
|
||||
/* Note: it is necessary to treat option as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_sysfs(u32 option, u32 arg1, u32 arg2)
|
||||
{
|
||||
return sys_sysfs((int)option, arg1, arg2);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYSVIPC
|
||||
long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr,
|
||||
u32 fifth)
|
||||
@ -156,125 +146,6 @@ asmlinkage long compat_sys_sendfile64_wrapper(u32 out_fd, u32 in_fd,
|
||||
(off_t __user *)offset, count);
|
||||
}
|
||||
|
||||
/* Note: it is necessary to treat option as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_prctl(u32 option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
|
||||
{
|
||||
return sys_prctl((int)option,
|
||||
(unsigned long) arg2,
|
||||
(unsigned long) arg3,
|
||||
(unsigned long) arg4,
|
||||
(unsigned long) arg5);
|
||||
}
|
||||
|
||||
/* Note: it is necessary to treat pid as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_sched_rr_get_interval_wrapper(u32 pid,
|
||||
struct compat_timespec __user *interval)
|
||||
{
|
||||
return compat_sys_sched_rr_get_interval((int)pid, interval);
|
||||
}
|
||||
|
||||
/* Note: it is necessary to treat mode as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_access(const char __user * filename, u32 mode)
|
||||
{
|
||||
return sys_access(filename, (int)mode);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat mode as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_creat(const char __user * pathname, u32 mode)
|
||||
{
|
||||
return sys_creat(pathname, (int)mode);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat pid and options as unsigned ints,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_waitpid(u32 pid, unsigned int __user * stat_addr, u32 options)
|
||||
{
|
||||
return sys_waitpid((int)pid, stat_addr, (int)options);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat gidsetsize as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_getgroups(u32 gidsetsize, gid_t __user *grouplist)
|
||||
{
|
||||
return sys_getgroups((int)gidsetsize, grouplist);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat pid as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_getpgid(u32 pid)
|
||||
{
|
||||
return sys_getpgid((int)pid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Note: it is necessary to treat pid as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_getsid(u32 pid)
|
||||
{
|
||||
return sys_getsid((int)pid);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat pid and sig as unsigned ints,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_kill(u32 pid, u32 sig)
|
||||
{
|
||||
return sys_kill((int)pid, (int)sig);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat mode as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_mkdir(const char __user * pathname, u32 mode)
|
||||
{
|
||||
return sys_mkdir(pathname, (int)mode);
|
||||
}
|
||||
|
||||
long compat_sys_nice(u32 increment)
|
||||
{
|
||||
/* sign extend increment */
|
||||
return sys_nice((int)increment);
|
||||
}
|
||||
|
||||
off_t ppc32_lseek(unsigned int fd, u32 offset, unsigned int origin)
|
||||
{
|
||||
/* sign extend n */
|
||||
@ -293,172 +164,6 @@ long compat_sys_ftruncate(int fd, u32 length)
|
||||
return sys_ftruncate(fd, (int)length);
|
||||
}
|
||||
|
||||
/* Note: it is necessary to treat bufsiz as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_readlink(const char __user * path, char __user * buf, u32 bufsiz)
|
||||
{
|
||||
return sys_readlink(path, buf, (int)bufsiz);
|
||||
}
|
||||
|
||||
/* Note: it is necessary to treat option as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_sched_get_priority_max(u32 policy)
|
||||
{
|
||||
return sys_sched_get_priority_max((int)policy);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat policy as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_sched_get_priority_min(u32 policy)
|
||||
{
|
||||
return sys_sched_get_priority_min((int)policy);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat pid as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_sched_getparam(u32 pid, struct sched_param __user *param)
|
||||
{
|
||||
return sys_sched_getparam((int)pid, param);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat pid as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_sched_getscheduler(u32 pid)
|
||||
{
|
||||
return sys_sched_getscheduler((int)pid);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat pid as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_sched_setparam(u32 pid, struct sched_param __user *param)
|
||||
{
|
||||
return sys_sched_setparam((int)pid, param);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat pid and policy as unsigned ints,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_sched_setscheduler(u32 pid, u32 policy, struct sched_param __user *param)
|
||||
{
|
||||
return sys_sched_setscheduler((int)pid, (int)policy, param);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat len as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_setdomainname(char __user *name, u32 len)
|
||||
{
|
||||
return sys_setdomainname(name, (int)len);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat gidsetsize as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_setgroups(u32 gidsetsize, gid_t __user *grouplist)
|
||||
{
|
||||
return sys_setgroups((int)gidsetsize, grouplist);
|
||||
}
|
||||
|
||||
|
||||
asmlinkage long compat_sys_sethostname(char __user *name, u32 len)
|
||||
{
|
||||
/* sign extend len */
|
||||
return sys_sethostname(name, (int)len);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat pid and pgid as unsigned ints,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_setpgid(u32 pid, u32 pgid)
|
||||
{
|
||||
return sys_setpgid((int)pid, (int)pgid);
|
||||
}
|
||||
|
||||
long compat_sys_getpriority(u32 which, u32 who)
|
||||
{
|
||||
/* sign extend which and who */
|
||||
return sys_getpriority((int)which, (int)who);
|
||||
}
|
||||
|
||||
long compat_sys_setpriority(u32 which, u32 who, u32 niceval)
|
||||
{
|
||||
/* sign extend which, who and niceval */
|
||||
return sys_setpriority((int)which, (int)who, (int)niceval);
|
||||
}
|
||||
|
||||
long compat_sys_ioprio_get(u32 which, u32 who)
|
||||
{
|
||||
/* sign extend which and who */
|
||||
return sys_ioprio_get((int)which, (int)who);
|
||||
}
|
||||
|
||||
long compat_sys_ioprio_set(u32 which, u32 who, u32 ioprio)
|
||||
{
|
||||
/* sign extend which, who and ioprio */
|
||||
return sys_ioprio_set((int)which, (int)who, (int)ioprio);
|
||||
}
|
||||
|
||||
/* Note: it is necessary to treat newmask as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_ssetmask(u32 newmask)
|
||||
{
|
||||
return sys_ssetmask((int) newmask);
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_syslog(u32 type, char __user * buf, u32 len)
|
||||
{
|
||||
/* sign extend len */
|
||||
return sys_syslog(type, buf, (int)len);
|
||||
}
|
||||
|
||||
|
||||
/* Note: it is necessary to treat mask as an unsigned int,
|
||||
* with the corresponding cast to a signed int to insure that the
|
||||
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
|
||||
* and the register representation of a signed int (msr in 64-bit mode) is performed.
|
||||
*/
|
||||
asmlinkage long compat_sys_umask(u32 mask)
|
||||
{
|
||||
return sys_umask((int)mask);
|
||||
}
|
||||
|
||||
unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
|
||||
unsigned long prot, unsigned long flags,
|
||||
unsigned long fd, unsigned long pgoff)
|
||||
@ -467,12 +172,6 @@ unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
|
||||
return sys_mmap(addr, len, prot, flags, fd, pgoff << 12);
|
||||
}
|
||||
|
||||
long compat_sys_tgkill(u32 tgid, u32 pid, int sig)
|
||||
{
|
||||
/* sign extend tgid, pid */
|
||||
return sys_tgkill((int)tgid, (int)pid, sig);
|
||||
}
|
||||
|
||||
/*
|
||||
* long long munging:
|
||||
* The 32 bit ABI passes long longs in an odd even register pair.
|
||||
|
@ -140,6 +140,13 @@ config S390
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
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
|
||||
select OLD_SIGSUSPEND3
|
||||
select OLD_SIGACTION
|
||||
|
||||
config SCHED_OMIT_FRAME_POINTER
|
||||
def_bool y
|
||||
@ -249,6 +256,7 @@ config COMPAT
|
||||
depends on 64BIT
|
||||
select COMPAT_BINFMT_ELF if BINFMT_ELF
|
||||
select ARCH_WANT_OLD_COMPAT_IPC
|
||||
select COMPAT_OLD_SIGACTION
|
||||
help
|
||||
Select this option if you want to enable your system kernel to
|
||||
handle system-calls from ELF binaries for 31 bit ESA. This option
|
||||
|
@ -21,12 +21,5 @@ typedef struct {
|
||||
unsigned long sig[_NSIG_WORDS];
|
||||
} sigset_t;
|
||||
|
||||
struct old_sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
old_sigset_t sa_mask;
|
||||
unsigned long sa_flags;
|
||||
void (*sa_restorer)(void);
|
||||
};
|
||||
|
||||
#define __ARCH_HAS_SA_RESTORER
|
||||
#endif
|
||||
|
@ -352,86 +352,6 @@ asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned
|
||||
return sys_ftruncate(fd, (high << 32) | low);
|
||||
}
|
||||
|
||||
asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
|
||||
struct compat_timespec __user *interval)
|
||||
{
|
||||
struct timespec t;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs ();
|
||||
|
||||
set_fs (KERNEL_DS);
|
||||
ret = sys_sched_rr_get_interval(pid,
|
||||
(struct timespec __force __user *) &t);
|
||||
set_fs (old_fs);
|
||||
if (put_compat_timespec(&t, interval))
|
||||
return -EFAULT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
|
||||
compat_sigset_t __user *oset, size_t sigsetsize)
|
||||
{
|
||||
sigset_t s;
|
||||
compat_sigset_t s32;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
if (set) {
|
||||
if (copy_from_user (&s32, set, sizeof(compat_sigset_t)))
|
||||
return -EFAULT;
|
||||
s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
|
||||
}
|
||||
set_fs (KERNEL_DS);
|
||||
ret = sys_rt_sigprocmask(how,
|
||||
set ? (sigset_t __force __user *) &s : NULL,
|
||||
oset ? (sigset_t __force __user *) &s : NULL,
|
||||
sigsetsize);
|
||||
set_fs (old_fs);
|
||||
if (ret) return ret;
|
||||
if (oset) {
|
||||
s32.sig[1] = (s.sig[0] >> 32);
|
||||
s32.sig[0] = s.sig[0];
|
||||
if (copy_to_user (oset, &s32, sizeof(compat_sigset_t)))
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
|
||||
size_t sigsetsize)
|
||||
{
|
||||
sigset_t s;
|
||||
compat_sigset_t s32;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
set_fs (KERNEL_DS);
|
||||
ret = sys_rt_sigpending((sigset_t __force __user *) &s, sigsetsize);
|
||||
set_fs (old_fs);
|
||||
if (!ret) {
|
||||
s32.sig[1] = (s.sig[0] >> 32);
|
||||
s32.sig[0] = s.sig[0];
|
||||
if (copy_to_user (set, &s32, sizeof(compat_sigset_t)))
|
||||
return -EFAULT;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage long
|
||||
sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
|
||||
{
|
||||
siginfo_t info;
|
||||
int ret;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
if (copy_siginfo_from_user32(&info, uinfo))
|
||||
return -EFAULT;
|
||||
set_fs (KERNEL_DS);
|
||||
ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __force __user *) &info);
|
||||
set_fs (old_fs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf,
|
||||
size_t count, u32 poshi, u32 poslo)
|
||||
{
|
||||
|
@ -17,13 +17,6 @@ struct ipc_kludge_32 {
|
||||
__s32 msgtyp;
|
||||
};
|
||||
|
||||
struct old_sigaction32 {
|
||||
__u32 sa_handler; /* Really a pointer, but need to deal with 32 bits */
|
||||
compat_old_sigset_t sa_mask; /* A 32 bit mask */
|
||||
__u32 sa_flags;
|
||||
__u32 sa_restorer; /* Another 32 bit pointer */
|
||||
};
|
||||
|
||||
/* asm/sigcontext.h */
|
||||
typedef union
|
||||
{
|
||||
@ -68,24 +61,12 @@ 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 */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
__u32 ss_sp; /* pointer */
|
||||
int ss_flags;
|
||||
compat_size_t ss_size;
|
||||
} stack_t32;
|
||||
|
||||
/* asm/ucontext.h */
|
||||
struct ucontext32 {
|
||||
__u32 uc_flags;
|
||||
__u32 uc_link; /* pointer */
|
||||
stack_t32 uc_stack;
|
||||
compat_stack_t uc_stack;
|
||||
_sigregs32 uc_mcontext;
|
||||
compat_sigset_t uc_sigmask; /* mask last for extensibility */
|
||||
};
|
||||
@ -93,8 +74,6 @@ struct ucontext32 {
|
||||
struct stat64_emu31;
|
||||
struct mmap_arg_struct_emu31;
|
||||
struct fadvise64_64_args;
|
||||
struct old_sigaction32;
|
||||
struct old_sigaction32;
|
||||
|
||||
long sys32_chown16(const char __user * filename, u16 user, u16 group);
|
||||
long sys32_lchown16(const char __user * filename, u16 user, u16 group);
|
||||
@ -119,12 +98,6 @@ long sys32_ipc(u32 call, int first, int second, int third, u32 ptr);
|
||||
long sys32_truncate64(const char __user * path, unsigned long high,
|
||||
unsigned long low);
|
||||
long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low);
|
||||
long sys32_sched_rr_get_interval(compat_pid_t pid,
|
||||
struct compat_timespec __user *interval);
|
||||
long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
|
||||
compat_sigset_t __user *oset, size_t sigsetsize);
|
||||
long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize);
|
||||
long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo);
|
||||
long sys32_init_module(void __user *umod, unsigned long len,
|
||||
const char __user *uargs);
|
||||
long sys32_delete_module(const char __user *name_user, unsigned int flags);
|
||||
@ -149,9 +122,4 @@ long sys32_read(unsigned int fd, char __user * buf, size_t count);
|
||||
long sys32_write(unsigned int fd, const char __user * buf, size_t count);
|
||||
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);
|
||||
long sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss);
|
||||
#endif /* _ASM_S390X_S390_H */
|
||||
|
@ -157,122 +157,6 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
|
||||
return err;
|
||||
}
|
||||
|
||||
asmlinkage long
|
||||
sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
|
||||
struct old_sigaction32 __user *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
unsigned long sa_handler, sa_restorer;
|
||||
int ret;
|
||||
|
||||
if (act) {
|
||||
compat_old_sigset_t mask;
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(sa_handler, &act->sa_handler) ||
|
||||
__get_user(sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
new_ka.sa.sa_handler = (__sighandler_t) sa_handler;
|
||||
new_ka.sa.sa_restorer = (void (*)(void)) sa_restorer;
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
sa_handler = (unsigned long) old_ka.sa.sa_handler;
|
||||
sa_restorer = (unsigned long) old_ka.sa.sa_restorer;
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(sa_handler, &oact->sa_handler) ||
|
||||
__put_user(sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
asmlinkage long
|
||||
sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss)
|
||||
{
|
||||
struct pt_regs *regs = task_pt_regs(current);
|
||||
stack_t kss, koss;
|
||||
unsigned long ss_sp;
|
||||
int ret, err = 0;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
if (uss) {
|
||||
if (!access_ok(VERIFY_READ, uss, sizeof(*uss)))
|
||||
return -EFAULT;
|
||||
err |= __get_user(ss_sp, &uss->ss_sp);
|
||||
err |= __get_user(kss.ss_size, &uss->ss_size);
|
||||
err |= __get_user(kss.ss_flags, &uss->ss_flags);
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
kss.ss_sp = (void __user *) ss_sp;
|
||||
}
|
||||
|
||||
set_fs (KERNEL_DS);
|
||||
ret = do_sigaltstack((stack_t __force __user *) (uss ? &kss : NULL),
|
||||
(stack_t __force __user *) (uoss ? &koss : NULL),
|
||||
regs->gprs[15]);
|
||||
set_fs (old_fs);
|
||||
|
||||
if (!ret && uoss) {
|
||||
if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss)))
|
||||
return -EFAULT;
|
||||
ss_sp = (unsigned long) koss.ss_sp;
|
||||
err |= __put_user(ss_sp, &uoss->ss_sp);
|
||||
err |= __put_user(koss.ss_size, &uoss->ss_size);
|
||||
err |= __put_user(koss.ss_flags, &uoss->ss_flags);
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs)
|
||||
{
|
||||
_s390_regs_common32 regs32;
|
||||
@ -380,10 +264,6 @@ asmlinkage long sys32_rt_sigreturn(void)
|
||||
struct pt_regs *regs = task_pt_regs(current);
|
||||
rt_sigframe32 __user *frame = (rt_sigframe32 __user *)regs->gprs[15];
|
||||
sigset_t set;
|
||||
stack_t st;
|
||||
__u32 ss_sp;
|
||||
int err;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
|
||||
goto badframe;
|
||||
@ -394,15 +274,8 @@ asmlinkage long sys32_rt_sigreturn(void)
|
||||
goto badframe;
|
||||
if (restore_sigregs_gprs_high(regs, frame->gprs_high))
|
||||
goto badframe;
|
||||
err = __get_user(ss_sp, &frame->uc.uc_stack.ss_sp);
|
||||
st.ss_sp = compat_ptr(ss_sp);
|
||||
err |= __get_user(st.ss_size, &frame->uc.uc_stack.ss_size);
|
||||
err |= __get_user(st.ss_flags, &frame->uc.uc_stack.ss_flags);
|
||||
if (err)
|
||||
if (compat_restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
set_fs (KERNEL_DS);
|
||||
do_sigaltstack((stack_t __force __user *)&st, NULL, regs->gprs[15]);
|
||||
set_fs (old_fs);
|
||||
return regs->gprs[2];
|
||||
badframe:
|
||||
force_sig(SIGSEGV, current);
|
||||
@ -530,10 +403,7 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
|
||||
/* Create the ucontext. */
|
||||
err |= __put_user(UC_EXTENDED, &frame->uc.uc_flags);
|
||||
err |= __put_user(0, &frame->uc.uc_link);
|
||||
err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
|
||||
err |= __put_user(sas_ss_flags(regs->gprs[15]),
|
||||
&frame->uc.uc_stack.ss_flags);
|
||||
err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
|
||||
err |= __compat_save_altstack(&frame->uc.uc_stack, regs->gprs[15]);
|
||||
err |= save_sigregs32(regs, &frame->uc.uc_mcontext);
|
||||
err |= save_sigregs_gprs_high(regs, frame->gprs_high);
|
||||
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
|
@ -24,12 +24,6 @@ ENTRY(sys32_write_wrapper)
|
||||
llgfr %r4,%r4 # size_t
|
||||
jg sys32_write # branch to system call
|
||||
|
||||
ENTRY(sys32_open_wrapper)
|
||||
llgtr %r2,%r2 # const char *
|
||||
lgfr %r3,%r3 # int
|
||||
lgfr %r4,%r4 # int
|
||||
jg compat_sys_open # branch to system call
|
||||
|
||||
ENTRY(sys32_close_wrapper)
|
||||
llgfr %r2,%r2 # unsigned int
|
||||
jg sys_close # branch to system call
|
||||
@ -226,12 +220,6 @@ ENTRY(sys32_dup2_wrapper)
|
||||
|
||||
#sys32_setsid_wrapper # void
|
||||
|
||||
ENTRY(sys32_sigaction_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # const struct old_sigaction *
|
||||
llgtr %r4,%r4 # struct old_sigaction32 *
|
||||
jg sys32_sigaction # branch to system call
|
||||
|
||||
ENTRY(sys32_setreuid16_wrapper)
|
||||
llgfr %r2,%r2 # __kernel_old_uid_emu31_t
|
||||
llgfr %r3,%r3 # __kernel_old_uid_emu31_t
|
||||
@ -396,17 +384,6 @@ ENTRY(sys32_syslog_wrapper)
|
||||
lgfr %r4,%r4 # int
|
||||
jg sys_syslog # branch to system call
|
||||
|
||||
ENTRY(compat_sys_setitimer_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # struct itimerval_emu31 *
|
||||
llgtr %r4,%r4 # struct itimerval_emu31 *
|
||||
jg compat_sys_setitimer # branch to system call
|
||||
|
||||
ENTRY(compat_sys_getitimer_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # struct itimerval_emu31 *
|
||||
jg compat_sys_getitimer # branch to system call
|
||||
|
||||
ENTRY(compat_sys_newstat_wrapper)
|
||||
llgtr %r2,%r2 # char *
|
||||
llgtr %r3,%r3 # struct stat_emu31 *
|
||||
@ -424,13 +401,6 @@ ENTRY(compat_sys_newfstat_wrapper)
|
||||
|
||||
#sys32_vhangup_wrapper # void
|
||||
|
||||
ENTRY(compat_sys_wait4_wrapper)
|
||||
lgfr %r2,%r2 # pid_t
|
||||
llgtr %r3,%r3 # unsigned int *
|
||||
lgfr %r4,%r4 # int
|
||||
llgtr %r5,%r5 # struct rusage *
|
||||
jg compat_sys_wait4 # branch to system call
|
||||
|
||||
ENTRY(sys32_swapoff_wrapper)
|
||||
llgtr %r2,%r2 # const char *
|
||||
jg sys_swapoff # branch to system call
|
||||
@ -474,12 +444,6 @@ ENTRY(sys32_mprotect_wrapper)
|
||||
llgfr %r4,%r4 # unsigned long
|
||||
jg sys_mprotect # branch to system call
|
||||
|
||||
ENTRY(compat_sys_sigprocmask_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # compat_old_sigset_t *
|
||||
llgtr %r4,%r4 # compat_old_sigset_t *
|
||||
jg compat_sys_sigprocmask # branch to system call
|
||||
|
||||
ENTRY(sys_init_module_wrapper)
|
||||
llgtr %r2,%r2 # void *
|
||||
llgfr %r3,%r3 # unsigned long
|
||||
@ -628,11 +592,6 @@ ENTRY(sys32_sched_get_priority_min_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
jg sys_sched_get_priority_min # branch to system call
|
||||
|
||||
ENTRY(sys32_sched_rr_get_interval_wrapper)
|
||||
lgfr %r2,%r2 # pid_t
|
||||
llgtr %r3,%r3 # struct compat_timespec *
|
||||
jg sys32_sched_rr_get_interval # branch to system call
|
||||
|
||||
ENTRY(compat_sys_nanosleep_wrapper)
|
||||
llgtr %r2,%r2 # struct compat_timespec *
|
||||
llgtr %r3,%r3 # struct compat_timespec *
|
||||
@ -686,43 +645,6 @@ ENTRY(sys32_prctl_wrapper)
|
||||
|
||||
#sys32_rt_sigreturn_wrapper # done in rt_sigreturn_glue
|
||||
|
||||
ENTRY(sys32_rt_sigaction_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
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
|
||||
|
||||
ENTRY(sys32_rt_sigprocmask_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # old_sigset_emu31 *
|
||||
llgtr %r4,%r4 # old_sigset_emu31 *
|
||||
llgfr %r5,%r5 # size_t
|
||||
jg sys32_rt_sigprocmask # branch to system call
|
||||
|
||||
ENTRY(sys32_rt_sigpending_wrapper)
|
||||
llgtr %r2,%r2 # sigset_emu31 *
|
||||
llgfr %r3,%r3 # size_t
|
||||
jg sys32_rt_sigpending # branch to system call
|
||||
|
||||
ENTRY(compat_sys_rt_sigtimedwait_wrapper)
|
||||
llgtr %r2,%r2 # const sigset_emu31_t *
|
||||
llgtr %r3,%r3 # siginfo_emu31_t *
|
||||
llgtr %r4,%r4 # const struct compat_timespec *
|
||||
llgfr %r5,%r5 # size_t
|
||||
jg compat_sys_rt_sigtimedwait # branch to system call
|
||||
|
||||
ENTRY(sys32_rt_sigqueueinfo_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
lgfr %r3,%r3 # int
|
||||
llgtr %r4,%r4 # siginfo_emu31_t *
|
||||
jg sys32_rt_sigqueueinfo # branch to system call
|
||||
|
||||
ENTRY(compat_sys_rt_sigsuspend_wrapper)
|
||||
llgtr %r2,%r2 # compat_sigset_t *
|
||||
llgfr %r3,%r3 # compat_size_t
|
||||
jg compat_sys_rt_sigsuspend
|
||||
|
||||
ENTRY(sys32_pread64_wrapper)
|
||||
llgfr %r2,%r2 # unsigned int
|
||||
llgtr %r3,%r3 # char *
|
||||
@ -760,11 +682,6 @@ ENTRY(sys32_capset_wrapper)
|
||||
llgtr %r3,%r3 # const cap_user_data_t
|
||||
jg sys_capset # branch to system call
|
||||
|
||||
ENTRY(sys32_sigaltstack_wrapper)
|
||||
llgtr %r2,%r2 # const stack_emu31_t *
|
||||
llgtr %r3,%r3 # stack_emu31_t *
|
||||
jg sys32_sigaltstack
|
||||
|
||||
ENTRY(sys32_sendfile_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
lgfr %r3,%r3 # int
|
||||
@ -921,16 +838,6 @@ ENTRY(sys32_fstat64_wrapper)
|
||||
llgtr %r3,%r3 # struct stat64 *
|
||||
jg sys32_fstat64 # branch to system call
|
||||
|
||||
ENTRY(compat_sys_futex_wrapper)
|
||||
llgtr %r2,%r2 # u32 *
|
||||
lgfr %r3,%r3 # int
|
||||
lgfr %r4,%r4 # int
|
||||
llgtr %r5,%r5 # struct compat_timespec *
|
||||
llgtr %r6,%r6 # u32 *
|
||||
lgf %r0,164(%r15) # int
|
||||
stg %r0,160(%r15)
|
||||
jg compat_sys_futex # branch to system call
|
||||
|
||||
ENTRY(sys32_setxattr_wrapper)
|
||||
llgtr %r2,%r2 # char *
|
||||
llgtr %r3,%r3 # char *
|
||||
@ -1216,14 +1123,6 @@ ENTRY(sys32_remap_file_pages_wrapper)
|
||||
llgfr %r6,%r6 # unsigned long
|
||||
jg sys_remap_file_pages
|
||||
|
||||
ENTRY(compat_sys_waitid_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
lgfr %r3,%r3 # pid_t
|
||||
llgtr %r4,%r4 # siginfo_emu31_t *
|
||||
lgfr %r5,%r5 # int
|
||||
llgtr %r6,%r6 # struct rusage_emu31 *
|
||||
jg compat_sys_waitid
|
||||
|
||||
ENTRY(compat_sys_kexec_load_wrapper)
|
||||
llgfr %r2,%r2 # unsigned long
|
||||
llgfr %r3,%r3 # unsigned long
|
||||
@ -1253,13 +1152,6 @@ ENTRY(sys_inotify_rm_watch_wrapper)
|
||||
llgfr %r3,%r3 # u32
|
||||
jg sys_inotify_rm_watch
|
||||
|
||||
ENTRY(compat_sys_openat_wrapper)
|
||||
llgfr %r2,%r2 # unsigned int
|
||||
llgtr %r3,%r3 # const char *
|
||||
lgfr %r4,%r4 # int
|
||||
lgfr %r5,%r5 # int
|
||||
jg compat_sys_openat
|
||||
|
||||
ENTRY(sys_mkdirat_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # const char *
|
||||
@ -1362,17 +1254,6 @@ ENTRY(sys_unshare_wrapper)
|
||||
llgfr %r2,%r2 # unsigned long
|
||||
jg sys_unshare
|
||||
|
||||
ENTRY(compat_sys_set_robust_list_wrapper)
|
||||
llgtr %r2,%r2 # struct compat_robust_list_head *
|
||||
llgfr %r3,%r3 # size_t
|
||||
jg compat_sys_set_robust_list
|
||||
|
||||
ENTRY(compat_sys_get_robust_list_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # compat_uptr_t_t *
|
||||
llgtr %r4,%r4 # compat_size_t *
|
||||
jg compat_sys_get_robust_list
|
||||
|
||||
ENTRY(sys_splice_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # loff_t *
|
||||
@ -1458,18 +1339,6 @@ ENTRY(sys_timerfd_create_wrapper)
|
||||
lgfr %r3,%r3 # int
|
||||
jg sys_timerfd_create
|
||||
|
||||
ENTRY(compat_sys_timerfd_settime_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
lgfr %r3,%r3 # int
|
||||
llgtr %r4,%r4 # struct compat_itimerspec *
|
||||
llgtr %r5,%r5 # struct compat_itimerspec *
|
||||
jg compat_sys_timerfd_settime
|
||||
|
||||
ENTRY(compat_sys_timerfd_gettime_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # struct compat_itimerspec *
|
||||
jg compat_sys_timerfd_gettime
|
||||
|
||||
ENTRY(compat_sys_signalfd4_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # compat_sigset_t *
|
||||
@ -1550,13 +1419,6 @@ ENTRY(compat_sys_pwritev_wrapper)
|
||||
llgfr %r6,%r6 # u32
|
||||
jg compat_sys_pwritev # branch to system call
|
||||
|
||||
ENTRY(compat_sys_rt_tgsigqueueinfo_wrapper)
|
||||
lgfr %r2,%r2 # compat_pid_t
|
||||
lgfr %r3,%r3 # compat_pid_t
|
||||
lgfr %r4,%r4 # int
|
||||
llgtr %r5,%r5 # struct compat_siginfo *
|
||||
jg compat_sys_rt_tgsigqueueinfo_wrapper # branch to system call
|
||||
|
||||
ENTRY(sys_perf_event_open_wrapper)
|
||||
llgtr %r2,%r2 # const struct perf_event_attr *
|
||||
lgfr %r3,%r3 # pid_t
|
||||
@ -1607,12 +1469,6 @@ ENTRY(sys_name_to_handle_at_wrapper)
|
||||
lgfr %r6,%r6 # int
|
||||
jg sys_name_to_handle_at
|
||||
|
||||
ENTRY(compat_sys_open_by_handle_at_wrapper)
|
||||
lgfr %r2,%r2 # int
|
||||
llgtr %r3,%r3 # struct file_handle __user *
|
||||
lgfr %r4,%r4 # int
|
||||
jg compat_sys_open_by_handle_at
|
||||
|
||||
ENTRY(compat_sys_clock_adjtime_wrapper)
|
||||
lgfr %r2,%r2 # clockid_t (int)
|
||||
llgtr %r3,%r3 # struct compat_timex __user *
|
||||
|
@ -73,10 +73,6 @@ long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low,
|
||||
long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args);
|
||||
long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high,
|
||||
u32 len_low);
|
||||
long sys_sigsuspend(int history0, int history1, old_sigset_t mask);
|
||||
long sys_sigaction(int sig, const struct old_sigaction __user *act,
|
||||
struct old_sigaction __user *oact);
|
||||
long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss);
|
||||
long sys_sigreturn(void);
|
||||
long sys_rt_sigreturn(void);
|
||||
long sys32_sigreturn(void);
|
||||
|
@ -48,54 +48,6 @@ typedef struct
|
||||
struct ucontext uc;
|
||||
} rt_sigframe;
|
||||
|
||||
/*
|
||||
* Atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE3(sigaction, int, sig, const struct old_sigaction __user *, act,
|
||||
struct old_sigaction __user *, oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
if (act) {
|
||||
old_sigset_t mask;
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
|
||||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE2(sigaltstack, const stack_t __user *, uss,
|
||||
stack_t __user *, uoss)
|
||||
{
|
||||
struct pt_regs *regs = task_pt_regs(current);
|
||||
return do_sigaltstack(uss, uoss, regs->gprs[15]);
|
||||
}
|
||||
|
||||
/* Returns non-zero on fault. */
|
||||
static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
|
||||
{
|
||||
@ -190,8 +142,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
|
||||
set_current_blocked(&set);
|
||||
if (restore_sigregs(regs, &frame->uc.uc_mcontext))
|
||||
goto badframe;
|
||||
if (do_sigaltstack(&frame->uc.uc_stack, NULL,
|
||||
regs->gprs[15]) == -EFAULT)
|
||||
if (restore_altstack(&frame->uc.uc_stack))
|
||||
goto badframe;
|
||||
return regs->gprs[2];
|
||||
badframe:
|
||||
@ -325,10 +276,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->gprs[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->gprs[15]);
|
||||
err |= save_sigregs(regs, &frame->uc.uc_mcontext);
|
||||
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
||||
if (err)
|
||||
|
@ -13,7 +13,7 @@ SYSCALL(sys_exit,sys_exit,sys32_exit_wrapper)
|
||||
SYSCALL(sys_fork,sys_fork,sys_fork)
|
||||
SYSCALL(sys_read,sys_read,sys32_read_wrapper)
|
||||
SYSCALL(sys_write,sys_write,sys32_write_wrapper)
|
||||
SYSCALL(sys_open,sys_open,sys32_open_wrapper) /* 5 */
|
||||
SYSCALL(sys_open,sys_open,compat_sys_open) /* 5 */
|
||||
SYSCALL(sys_close,sys_close,sys32_close_wrapper)
|
||||
SYSCALL(sys_restart_syscall,sys_restart_syscall,sys_restart_syscall)
|
||||
SYSCALL(sys_creat,sys_creat,sys32_creat_wrapper)
|
||||
@ -75,7 +75,7 @@ SYSCALL(sys_dup2,sys_dup2,sys32_dup2_wrapper)
|
||||
SYSCALL(sys_getppid,sys_getppid,sys_getppid)
|
||||
SYSCALL(sys_getpgrp,sys_getpgrp,sys_getpgrp) /* 65 */
|
||||
SYSCALL(sys_setsid,sys_setsid,sys_setsid)
|
||||
SYSCALL(sys_sigaction,sys_sigaction,sys32_sigaction_wrapper)
|
||||
SYSCALL(sys_sigaction,sys_sigaction,compat_sys_sigaction)
|
||||
NI_SYSCALL /* old sgetmask syscall*/
|
||||
NI_SYSCALL /* old ssetmask syscall*/
|
||||
SYSCALL(sys_setreuid16,sys_ni_syscall,sys32_setreuid16_wrapper) /* old setreuid16 syscall */
|
||||
@ -112,8 +112,8 @@ SYSCALL(sys_fstatfs,sys_fstatfs,compat_sys_fstatfs_wrapper) /* 100 */
|
||||
NI_SYSCALL /* ioperm for i386 */
|
||||
SYSCALL(sys_socketcall,sys_socketcall,compat_sys_socketcall_wrapper)
|
||||
SYSCALL(sys_syslog,sys_syslog,sys32_syslog_wrapper)
|
||||
SYSCALL(sys_setitimer,sys_setitimer,compat_sys_setitimer_wrapper)
|
||||
SYSCALL(sys_getitimer,sys_getitimer,compat_sys_getitimer_wrapper) /* 105 */
|
||||
SYSCALL(sys_setitimer,sys_setitimer,compat_sys_setitimer)
|
||||
SYSCALL(sys_getitimer,sys_getitimer,compat_sys_getitimer) /* 105 */
|
||||
SYSCALL(sys_newstat,sys_newstat,compat_sys_newstat_wrapper)
|
||||
SYSCALL(sys_newlstat,sys_newlstat,compat_sys_newlstat_wrapper)
|
||||
SYSCALL(sys_newfstat,sys_newfstat,compat_sys_newfstat_wrapper)
|
||||
@ -122,7 +122,7 @@ SYSCALL(sys_lookup_dcookie,sys_lookup_dcookie,sys32_lookup_dcookie_wrapper) /* 1
|
||||
SYSCALL(sys_vhangup,sys_vhangup,sys_vhangup)
|
||||
NI_SYSCALL /* old "idle" system call */
|
||||
NI_SYSCALL /* vm86old for i386 */
|
||||
SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4_wrapper)
|
||||
SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4)
|
||||
SYSCALL(sys_swapoff,sys_swapoff,sys32_swapoff_wrapper) /* 115 */
|
||||
SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo_wrapper)
|
||||
SYSCALL(sys_s390_ipc,sys_s390_ipc,sys32_ipc_wrapper)
|
||||
@ -134,7 +134,7 @@ SYSCALL(sys_newuname,sys_newuname,sys32_newuname_wrapper)
|
||||
NI_SYSCALL /* modify_ldt for i386 */
|
||||
SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper)
|
||||
SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */
|
||||
SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper)
|
||||
SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask)
|
||||
NI_SYSCALL /* old "create module" */
|
||||
SYSCALL(sys_init_module,sys_init_module,sys_init_module_wrapper)
|
||||
SYSCALL(sys_delete_module,sys_delete_module,sys_delete_module_wrapper)
|
||||
@ -169,7 +169,7 @@ SYSCALL(sys_sched_getscheduler,sys_sched_getscheduler,sys32_sched_getscheduler_w
|
||||
SYSCALL(sys_sched_yield,sys_sched_yield,sys_sched_yield)
|
||||
SYSCALL(sys_sched_get_priority_max,sys_sched_get_priority_max,sys32_sched_get_priority_max_wrapper)
|
||||
SYSCALL(sys_sched_get_priority_min,sys_sched_get_priority_min,sys32_sched_get_priority_min_wrapper) /* 160 */
|
||||
SYSCALL(sys_sched_rr_get_interval,sys_sched_rr_get_interval,sys32_sched_rr_get_interval_wrapper)
|
||||
SYSCALL(sys_sched_rr_get_interval,sys_sched_rr_get_interval,compat_sys_sched_rr_get_interval)
|
||||
SYSCALL(sys_nanosleep,sys_nanosleep,compat_sys_nanosleep_wrapper)
|
||||
SYSCALL(sys_mremap,sys_mremap,sys32_mremap_wrapper)
|
||||
SYSCALL(sys_setresuid16,sys_ni_syscall,sys32_setresuid16_wrapper) /* old setresuid16 syscall */
|
||||
@ -182,19 +182,19 @@ SYSCALL(sys_setresgid16,sys_ni_syscall,sys32_setresgid16_wrapper) /* 170 old set
|
||||
SYSCALL(sys_getresgid16,sys_ni_syscall,sys32_getresgid16_wrapper) /* old getresgid16 syscall */
|
||||
SYSCALL(sys_prctl,sys_prctl,sys32_prctl_wrapper)
|
||||
SYSCALL(sys_rt_sigreturn,sys_rt_sigreturn,sys32_rt_sigreturn)
|
||||
SYSCALL(sys_rt_sigaction,sys_rt_sigaction,sys32_rt_sigaction_wrapper)
|
||||
SYSCALL(sys_rt_sigprocmask,sys_rt_sigprocmask,sys32_rt_sigprocmask_wrapper) /* 175 */
|
||||
SYSCALL(sys_rt_sigpending,sys_rt_sigpending,sys32_rt_sigpending_wrapper)
|
||||
SYSCALL(sys_rt_sigtimedwait,sys_rt_sigtimedwait,compat_sys_rt_sigtimedwait_wrapper)
|
||||
SYSCALL(sys_rt_sigqueueinfo,sys_rt_sigqueueinfo,sys32_rt_sigqueueinfo_wrapper)
|
||||
SYSCALL(sys_rt_sigsuspend,sys_rt_sigsuspend,compat_sys_rt_sigsuspend_wrapper)
|
||||
SYSCALL(sys_rt_sigaction,sys_rt_sigaction,compat_sys_rt_sigaction)
|
||||
SYSCALL(sys_rt_sigprocmask,sys_rt_sigprocmask,compat_sys_rt_sigprocmask) /* 175 */
|
||||
SYSCALL(sys_rt_sigpending,sys_rt_sigpending,compat_sys_rt_sigpending)
|
||||
SYSCALL(sys_rt_sigtimedwait,sys_rt_sigtimedwait,compat_sys_rt_sigtimedwait)
|
||||
SYSCALL(sys_rt_sigqueueinfo,sys_rt_sigqueueinfo,compat_sys_rt_sigqueueinfo)
|
||||
SYSCALL(sys_rt_sigsuspend,sys_rt_sigsuspend,compat_sys_rt_sigsuspend)
|
||||
SYSCALL(sys_pread64,sys_pread64,sys32_pread64_wrapper) /* 180 */
|
||||
SYSCALL(sys_pwrite64,sys_pwrite64,sys32_pwrite64_wrapper)
|
||||
SYSCALL(sys_chown16,sys_ni_syscall,sys32_chown16_wrapper) /* old chown16 syscall */
|
||||
SYSCALL(sys_getcwd,sys_getcwd,sys32_getcwd_wrapper)
|
||||
SYSCALL(sys_capget,sys_capget,sys32_capget_wrapper)
|
||||
SYSCALL(sys_capset,sys_capset,sys32_capset_wrapper) /* 185 */
|
||||
SYSCALL(sys_sigaltstack,sys_sigaltstack,sys32_sigaltstack_wrapper)
|
||||
SYSCALL(sys_sigaltstack,sys_sigaltstack,compat_sys_sigaltstack)
|
||||
SYSCALL(sys_sendfile,sys_sendfile64,sys32_sendfile_wrapper)
|
||||
NI_SYSCALL /* streams1 */
|
||||
NI_SYSCALL /* streams2 */
|
||||
@ -246,7 +246,7 @@ SYSCALL(sys_lremovexattr,sys_lremovexattr,sys32_lremovexattr_wrapper)
|
||||
SYSCALL(sys_fremovexattr,sys_fremovexattr,sys32_fremovexattr_wrapper) /* 235 */
|
||||
SYSCALL(sys_gettid,sys_gettid,sys_gettid)
|
||||
SYSCALL(sys_tkill,sys_tkill,sys_tkill_wrapper)
|
||||
SYSCALL(sys_futex,sys_futex,compat_sys_futex_wrapper)
|
||||
SYSCALL(sys_futex,sys_futex,compat_sys_futex)
|
||||
SYSCALL(sys_sched_setaffinity,sys_sched_setaffinity,sys32_sched_setaffinity_wrapper)
|
||||
SYSCALL(sys_sched_getaffinity,sys_sched_getaffinity,sys32_sched_getaffinity_wrapper) /* 240 */
|
||||
SYSCALL(sys_tgkill,sys_tgkill,sys_tgkill_wrapper)
|
||||
@ -289,14 +289,14 @@ SYSCALL(sys_kexec_load,sys_kexec_load,compat_sys_kexec_load_wrapper)
|
||||
SYSCALL(sys_add_key,sys_add_key,compat_sys_add_key_wrapper)
|
||||
SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper)
|
||||
SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl_wrapper) /* 280 */
|
||||
SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid_wrapper)
|
||||
SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid)
|
||||
SYSCALL(sys_ioprio_set,sys_ioprio_set,sys_ioprio_set_wrapper)
|
||||
SYSCALL(sys_ioprio_get,sys_ioprio_get,sys_ioprio_get_wrapper)
|
||||
SYSCALL(sys_inotify_init,sys_inotify_init,sys_inotify_init)
|
||||
SYSCALL(sys_inotify_add_watch,sys_inotify_add_watch,sys_inotify_add_watch_wrapper) /* 285 */
|
||||
SYSCALL(sys_inotify_rm_watch,sys_inotify_rm_watch,sys_inotify_rm_watch_wrapper)
|
||||
NI_SYSCALL /* 287 sys_migrate_pages */
|
||||
SYSCALL(sys_openat,sys_openat,compat_sys_openat_wrapper)
|
||||
SYSCALL(sys_openat,sys_openat,compat_sys_openat)
|
||||
SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper)
|
||||
SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */
|
||||
SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper)
|
||||
@ -312,8 +312,8 @@ SYSCALL(sys_faccessat,sys_faccessat,sys_faccessat_wrapper) /* 300 */
|
||||
SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6_wrapper)
|
||||
SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll_wrapper)
|
||||
SYSCALL(sys_unshare,sys_unshare,sys_unshare_wrapper)
|
||||
SYSCALL(sys_set_robust_list,sys_set_robust_list,compat_sys_set_robust_list_wrapper)
|
||||
SYSCALL(sys_get_robust_list,sys_get_robust_list,compat_sys_get_robust_list_wrapper)
|
||||
SYSCALL(sys_set_robust_list,sys_set_robust_list,compat_sys_set_robust_list)
|
||||
SYSCALL(sys_get_robust_list,sys_get_robust_list,compat_sys_get_robust_list)
|
||||
SYSCALL(sys_splice,sys_splice,sys_splice_wrapper)
|
||||
SYSCALL(sys_sync_file_range,sys_sync_file_range,sys_sync_file_range_wrapper)
|
||||
SYSCALL(sys_tee,sys_tee,sys_tee_wrapper)
|
||||
@ -328,8 +328,8 @@ SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper)
|
||||
NI_SYSCALL /* 317 old sys_timer_fd */
|
||||
SYSCALL(sys_eventfd,sys_eventfd,sys_eventfd_wrapper)
|
||||
SYSCALL(sys_timerfd_create,sys_timerfd_create,sys_timerfd_create_wrapper)
|
||||
SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime_wrapper) /* 320 */
|
||||
SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime_wrapper)
|
||||
SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime) /* 320 */
|
||||
SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime)
|
||||
SYSCALL(sys_signalfd4,sys_signalfd4,compat_sys_signalfd4_wrapper)
|
||||
SYSCALL(sys_eventfd2,sys_eventfd2,sys_eventfd2_wrapper)
|
||||
SYSCALL(sys_inotify_init1,sys_inotify_init1,sys_inotify_init1_wrapper)
|
||||
@ -338,13 +338,13 @@ SYSCALL(sys_dup3,sys_dup3,sys_dup3_wrapper)
|
||||
SYSCALL(sys_epoll_create1,sys_epoll_create1,sys_epoll_create1_wrapper)
|
||||
SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper)
|
||||
SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper)
|
||||
SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo_wrapper) /* 330 */
|
||||
SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo) /* 330 */
|
||||
SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper)
|
||||
SYSCALL(sys_fanotify_init,sys_fanotify_init,sys_fanotify_init_wrapper)
|
||||
SYSCALL(sys_fanotify_mark,sys_fanotify_mark,sys_fanotify_mark_wrapper)
|
||||
SYSCALL(sys_prlimit64,sys_prlimit64,sys_prlimit64_wrapper)
|
||||
SYSCALL(sys_name_to_handle_at,sys_name_to_handle_at,sys_name_to_handle_at_wrapper) /* 335 */
|
||||
SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at_wrapper)
|
||||
SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at)
|
||||
SYSCALL(sys_clock_adjtime,sys_clock_adjtime,compat_sys_clock_adjtime_wrapper)
|
||||
SYSCALL(sys_syncfs,sys_syncfs,sys_syncfs_wrapper)
|
||||
SYSCALL(sys_setns,sys_setns,sys_setns_wrapper)
|
||||
|
@ -14,6 +14,7 @@ config SCORE
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select MODULES_USE_ELF_REL
|
||||
select CLONE_BACKWARDS
|
||||
select GENERIC_SIGALTSTACK
|
||||
|
||||
choice
|
||||
prompt "System type"
|
||||
|
@ -1,7 +1,6 @@
|
||||
#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>
|
||||
|
@ -491,8 +491,3 @@ 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
|
||||
|
@ -133,16 +133,6 @@ 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)
|
||||
{
|
||||
@ -167,9 +157,7 @@ score_rt_sigreturn(struct pt_regs *regs)
|
||||
else if (sig)
|
||||
force_sig(sig, current);
|
||||
|
||||
/* 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)
|
||||
if (restore_altstack(&frame->rs_uc.uc_stack))
|
||||
goto badframe;
|
||||
regs->is_syscall = 0;
|
||||
|
||||
@ -209,12 +197,7 @@ 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 |= __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 |= __save_altstack(&frame->rs_uc.uc_stack, regs->regs[0]);
|
||||
err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext);
|
||||
err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set));
|
||||
|
||||
|
@ -40,6 +40,9 @@ config SUPERH
|
||||
select GENERIC_STRNLEN_USER
|
||||
select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_SIGALTSTACK
|
||||
select OLD_SIGSUSPEND
|
||||
select OLD_SIGACTION
|
||||
help
|
||||
The SuperH is a RISC processor targeted for use in embedded systems
|
||||
and consumer electronics; it was also used in the Sega Dreamcast
|
||||
|
@ -9,12 +9,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);
|
||||
|
@ -5,11 +5,13 @@
|
||||
|
||||
#include <asm-generic/signal.h>
|
||||
|
||||
#ifndef __KERNEL__
|
||||
struct old_sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
old_sigset_t sa_mask;
|
||||
unsigned long sa_flags;
|
||||
void (*sa_restorer)(void);
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_SH_SIGNAL_H */
|
||||
|
@ -46,60 +46,6 @@ struct fdpic_func_descriptor {
|
||||
*/
|
||||
#define UNWINDGUARD 64
|
||||
|
||||
/*
|
||||
* Atomically swap in the new signal mask, and wait for a signal.
|
||||
*/
|
||||
asmlinkage int
|
||||
sys_sigsuspend(old_sigset_t mask)
|
||||
{
|
||||
sigset_t blocked;
|
||||
siginitset(&blocked, mask);
|
||||
return sigsuspend(&blocked);
|
||||
}
|
||||
|
||||
asmlinkage int
|
||||
sys_sigaction(int sig, const struct old_sigaction __user *act,
|
||||
struct old_sigaction __user *oact)
|
||||
{
|
||||
struct k_sigaction new_ka, old_ka;
|
||||
int ret;
|
||||
|
||||
if (act) {
|
||||
old_sigset_t mask;
|
||||
if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
|
||||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
|
||||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
|
||||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
|
||||
__get_user(mask, &act->sa_mask))
|
||||
return -EFAULT;
|
||||
siginitset(&new_ka.sa.sa_mask, mask);
|
||||
}
|
||||
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
|
||||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
|
||||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
|
||||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
|
||||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
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.
|
||||
*/
|
||||
@ -257,8 +203,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;
|
||||
@ -423,11 +368,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));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user