aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mn10300')
-rw-r--r--arch/mn10300/Kconfig1
-rw-r--r--arch/mn10300/include/asm/signal.h4
-rw-r--r--arch/mn10300/include/asm/unistd.h4
-rw-r--r--arch/mn10300/kernel/entry.S7
-rw-r--r--arch/mn10300/kernel/process.c33
5 files changed, 10 insertions, 39 deletions
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index 04669fac117b..72471744a912 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -9,6 +9,7 @@ config MN10300
9 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER 9 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
10 select GENERIC_CLOCKEVENTS 10 select GENERIC_CLOCKEVENTS
11 select GENERIC_KERNEL_THREAD 11 select GENERIC_KERNEL_THREAD
12 select GENERIC_KERNEL_EXECVE
12 select MODULES_USE_ELF_RELA 13 select MODULES_USE_ELF_RELA
13 14
14config AM33_2 15config AM33_2
diff --git a/arch/mn10300/include/asm/signal.h b/arch/mn10300/include/asm/signal.h
index f9668ec3040c..d280e9780793 100644
--- a/arch/mn10300/include/asm/signal.h
+++ b/arch/mn10300/include/asm/signal.h
@@ -45,8 +45,4 @@ struct k_sigaction {
45}; 45};
46#include <asm/sigcontext.h> 46#include <asm/sigcontext.h>
47 47
48
49struct pt_regs;
50#define ptrace_signal_deliver(regs, cookie) do { } while (0)
51
52#endif /* _ASM_SIGNAL_H */ 48#endif /* _ASM_SIGNAL_H */
diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h
index 55bbec1887e9..cabf8ba73b27 100644
--- a/arch/mn10300/include/asm/unistd.h
+++ b/arch/mn10300/include/asm/unistd.h
@@ -44,7 +44,9 @@
44#define __ARCH_WANT_SYS_RT_SIGACTION 44#define __ARCH_WANT_SYS_RT_SIGACTION
45#define __ARCH_WANT_SYS_RT_SIGSUSPEND 45#define __ARCH_WANT_SYS_RT_SIGSUSPEND
46#define __ARCH_WANT_SYS_EXECVE 46#define __ARCH_WANT_SYS_EXECVE
47#define __ARCH_WANT_KERNEL_EXECVE 47#define __ARCH_WANT_SYS_FORK
48#define __ARCH_WANT_SYS_VFORK
49#define __ARCH_WANT_SYS_CLONE
48 50
49/* 51/*
50 * "Conditional" syscalls 52 * "Conditional" syscalls
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S
index 0c631d34c8d7..68fcab8f8f6f 100644
--- a/arch/mn10300/kernel/entry.S
+++ b/arch/mn10300/kernel/entry.S
@@ -60,13 +60,8 @@ ENTRY(ret_from_kernel_thread)
60 mov (REG_D0,fp),d0 60 mov (REG_D0,fp),d0
61 mov (REG_A0,fp),a0 61 mov (REG_A0,fp),a0
62 calls (a0) 62 calls (a0)
63 jmp sys_exit
64
65ENTRY(ret_from_kernel_execve)
66 add -12,d0 /* pt_regs -> frame */
67 mov d0,sp
68 GET_THREAD_INFO a2
69 clr d0 63 clr d0
64 mov d0,(REG_D0,fp)
70 jmp syscall_exit 65 jmp syscall_exit
71 66
72############################################################################### 67###############################################################################
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c
index d0c671b6d9ff..eb09f5a552ff 100644
--- a/arch/mn10300/kernel/process.c
+++ b/arch/mn10300/kernel/process.c
@@ -206,7 +206,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
206 */ 206 */
207int copy_thread(unsigned long clone_flags, 207int copy_thread(unsigned long clone_flags,
208 unsigned long c_usp, unsigned long ustk_size, 208 unsigned long c_usp, unsigned long ustk_size,
209 struct task_struct *p, struct pt_regs *kregs) 209 struct task_struct *p)
210{ 210{
211 struct thread_info *ti = task_thread_info(p); 211 struct thread_info *ti = task_thread_info(p);
212 struct pt_regs *c_regs; 212 struct pt_regs *c_regs;
@@ -227,7 +227,7 @@ int copy_thread(unsigned long clone_flags,
227 p->thread.wchan = p->thread.pc; 227 p->thread.wchan = p->thread.pc;
228 p->thread.usp = c_usp; 228 p->thread.usp = c_usp;
229 229
230 if (unlikely(!kregs)) { 230 if (unlikely(p->flags & PF_KTHREAD)) {
231 memset(c_regs, 0, sizeof(struct pt_regs)); 231 memset(c_regs, 0, sizeof(struct pt_regs));
232 c_regs->a0 = c_usp; /* function */ 232 c_regs->a0 = c_usp; /* function */
233 c_regs->d0 = ustk_size; /* argument */ 233 c_regs->d0 = ustk_size; /* argument */
@@ -236,8 +236,9 @@ int copy_thread(unsigned long clone_flags,
236 p->thread.pc = (unsigned long) ret_from_kernel_thread; 236 p->thread.pc = (unsigned long) ret_from_kernel_thread;
237 return 0; 237 return 0;
238 } 238 }
239 *c_regs = *kregs; 239 *c_regs = *current_pt_regs();
240 c_regs->sp = c_usp; 240 if (c_usp)
241 c_regs->sp = c_usp;
241 c_regs->epsw &= ~EPSW_FE; /* my FPU */ 242 c_regs->epsw &= ~EPSW_FE; /* my FPU */
242 243
243 /* the new TLS pointer is passed in as arg #5 to sys_clone() */ 244 /* the new TLS pointer is passed in as arg #5 to sys_clone() */
@@ -249,30 +250,6 @@ int copy_thread(unsigned long clone_flags,
249 return 0; 250 return 0;
250} 251}
251 252
252/*
253 * clone a process
254 * - tlsptr is retrieved by copy_thread() from current_frame()->d3
255 */
256asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp,
257 int __user *parent_tidptr, int __user *child_tidptr,
258 int __user *tlsptr)
259{
260 return do_fork(clone_flags, newsp ?: current_frame()->sp,
261 current_frame(), 0, parent_tidptr, child_tidptr);
262}
263
264asmlinkage long sys_fork(void)
265{
266 return do_fork(SIGCHLD, current_frame()->sp,
267 current_frame(), 0, NULL, NULL);
268}
269
270asmlinkage long sys_vfork(void)
271{
272 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, current_frame()->sp,
273 current_frame(), 0, NULL, NULL);
274}
275
276unsigned long get_wchan(struct task_struct *p) 253unsigned long get_wchan(struct task_struct *p)
277{ 254{
278 return p->thread.wchan; 255 return p->thread.wchan;