aboutsummaryrefslogtreecommitdiffstats
path: root/arch/hexagon
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-10-26 19:25:46 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-11-28 22:42:44 -0500
commitf01aceac61ad5cc9ea463f6bb185c1f72702357f (patch)
tree30144f74aedd0eb517d4c755a318a6b7241f2475 /arch/hexagon
parent0ad9513d0f81584c25f3fc7ff582c382cc1a93f7 (diff)
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.h1
-rw-r--r--arch/hexagon/kernel/Makefile3
-rw-r--r--arch/hexagon/kernel/process.c7
-rw-r--r--arch/hexagon/kernel/syscall.c47
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 @@
28 28
29#define sys_mmap2 sys_mmap_pgoff 29#define sys_mmap2 sys_mmap_pgoff
30#define __ARCH_WANT_SYS_EXECVE 30#define __ARCH_WANT_SYS_EXECVE
31#define __ARCH_WANT_SYS_CLONE
31 32
32#include <asm-generic/unistd.h> 33#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
3obj-$(CONFIG_SMP) += smp.o topology.o 3obj-$(CONFIG_SMP) += smp.o topology.o
4 4
5obj-y += setup.o irq_cpu.o traps.o syscalltab.o signal.o time.o 5obj-y += setup.o irq_cpu.o traps.o syscalltab.o signal.o time.o
6obj-y += process.o syscall.o trampoline.o reset.o ptrace.o 6obj-y += process.o trampoline.o reset.o ptrace.o vdso.o
7obj-y += vdso.o
8 7
9obj-$(CONFIG_KGDB) += kgdb.o 8obj-$(CONFIG_KGDB) += kgdb.o
10obj-$(CONFIG_MODULES) += module.o hexagon_ksyms.o 9obj-$(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)
88 */ 88 */
89int copy_thread(unsigned long clone_flags, unsigned long usp, 89int copy_thread(unsigned long clone_flags, unsigned long usp,
90 unsigned long arg, struct task_struct *p, 90 unsigned long arg, struct task_struct *p,
91 struct pt_regs *regs) 91 struct pt_regs *unused)
92{ 92{
93 struct thread_info *ti = task_thread_info(p); 93 struct thread_info *ti = task_thread_info(p);
94 struct hexagon_switch_stack *ss; 94 struct hexagon_switch_stack *ss;
@@ -117,10 +117,11 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
117 pt_set_kmode(childregs); 117 pt_set_kmode(childregs);
118 return 0; 118 return 0;
119 } 119 }
120 memcpy(childregs, regs, sizeof(*childregs)); 120 memcpy(childregs, current_pt_regs(), sizeof(*childregs));
121 ss->r2524 = 0; 121 ss->r2524 = 0;
122 122
123 pt_set_rte_sp(childregs, usp); 123 if (usp)
124 pt_set_rte_sp(childregs, usp);
124 125
125 /* Child sees zero return value */ 126 /* Child sees zero return value */
126 childregs->r00 = 0; 127 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 @@
1/*
2 * Hexagon system calls
3 *
4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 */
20
21#include <linux/file.h>
22#include <linux/fs.h>
23#include <linux/linkage.h>
24#include <linux/mm.h>
25#include <linux/module.h>
26#include <linux/sched.h>
27#include <linux/slab.h>
28#include <linux/syscalls.h>
29#include <linux/unistd.h>
30#include <asm/mman.h>
31#include <asm/registers.h>
32
33/*
34 * System calls with architecture-specific wrappers.
35 * See signal.c for signal-related system call wrappers.
36 */
37
38asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
39 unsigned long parent_tidp, unsigned long child_tidp)
40{
41 struct pt_regs *pregs = current_pt_regs();
42
43 if (!newsp)
44 newsp = pregs->SP;
45 return do_fork(clone_flags, newsp, pregs, 0, (int __user *)parent_tidp,
46 (int __user *)child_tidp);
47}