diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-26 19:25:46 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-28 22:42:44 -0500 |
commit | f01aceac61ad5cc9ea463f6bb185c1f72702357f (patch) | |
tree | 30144f74aedd0eb517d4c755a318a6b7241f2475 /arch/hexagon | |
parent | 0ad9513d0f81584c25f3fc7ff582c382cc1a93f7 (diff) | |
download | linux-f01aceac61ad5cc9ea463f6bb185c1f72702357f.tar.bz2 |
hexagon: switch to generic clone()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/hexagon')
-rw-r--r-- | arch/hexagon/include/uapi/asm/unistd.h | 1 | ||||
-rw-r--r-- | arch/hexagon/kernel/Makefile | 3 | ||||
-rw-r--r-- | arch/hexagon/kernel/process.c | 7 | ||||
-rw-r--r-- | arch/hexagon/kernel/syscall.c | 47 |
4 files changed, 6 insertions, 52 deletions
diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h index 26b2e0f909c8..2af81533bd0f 100644 --- a/arch/hexagon/include/uapi/asm/unistd.h +++ b/arch/hexagon/include/uapi/asm/unistd.h @@ -28,5 +28,6 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_SYS_EXECVE +#define __ARCH_WANT_SYS_CLONE #include <asm-generic/unistd.h> diff --git a/arch/hexagon/kernel/Makefile b/arch/hexagon/kernel/Makefile index 536aec093e62..6c19501b487c 100644 --- a/arch/hexagon/kernel/Makefile +++ b/arch/hexagon/kernel/Makefile @@ -3,8 +3,7 @@ extra-y := head.o vmlinux.lds obj-$(CONFIG_SMP) += smp.o topology.o obj-y += setup.o irq_cpu.o traps.o syscalltab.o signal.o time.o -obj-y += process.o syscall.o trampoline.o reset.o ptrace.o -obj-y += vdso.o +obj-y += process.o trampoline.o reset.o ptrace.o vdso.o obj-$(CONFIG_KGDB) += kgdb.o obj-$(CONFIG_MODULES) += module.o hexagon_ksyms.o diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c index cfbc52bd5227..36dce17ed25c 100644 --- a/arch/hexagon/kernel/process.c +++ b/arch/hexagon/kernel/process.c @@ -88,7 +88,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk) */ int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg, struct task_struct *p, - struct pt_regs *regs) + struct pt_regs *unused) { struct thread_info *ti = task_thread_info(p); struct hexagon_switch_stack *ss; @@ -117,10 +117,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, pt_set_kmode(childregs); return 0; } - memcpy(childregs, regs, sizeof(*childregs)); + memcpy(childregs, current_pt_regs(), sizeof(*childregs)); ss->r2524 = 0; - pt_set_rte_sp(childregs, usp); + if (usp) + pt_set_rte_sp(childregs, usp); /* Child sees zero return value */ childregs->r00 = 0; diff --git a/arch/hexagon/kernel/syscall.c b/arch/hexagon/kernel/syscall.c deleted file mode 100644 index d2cc3270af3e..000000000000 --- a/arch/hexagon/kernel/syscall.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Hexagon system calls - * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -#include <linux/file.h> -#include <linux/fs.h> -#include <linux/linkage.h> -#include <linux/mm.h> -#include <linux/module.h> -#include <linux/sched.h> -#include <linux/slab.h> -#include <linux/syscalls.h> -#include <linux/unistd.h> -#include <asm/mman.h> -#include <asm/registers.h> - -/* - * System calls with architecture-specific wrappers. - * See signal.c for signal-related system call wrappers. - */ - -asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, - unsigned long parent_tidp, unsigned long child_tidp) -{ - struct pt_regs *pregs = current_pt_regs(); - - if (!newsp) - newsp = pregs->SP; - return do_fork(clone_flags, newsp, pregs, 0, (int __user *)parent_tidp, - (int __user *)child_tidp); -} |