diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-27 00:07:24 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-28 22:46:54 -0500 |
commit | 3416e8098aa4c0eea1b2e5c4efc68cf61a848864 (patch) | |
tree | afa086cb8cb285b677e6c990bff66af53076f7ce /arch | |
parent | e9eac30418dbbe51217a7c91906d349f9f4658e1 (diff) |
h8300: switch to generic fork/vfork/clone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/h8300/include/asm/unistd.h | 3 | ||||
-rw-r--r-- | arch/h8300/kernel/process.c | 38 | ||||
-rw-r--r-- | arch/h8300/kernel/syscalls.S | 9 |
3 files changed, 6 insertions, 44 deletions
diff --git a/arch/h8300/include/asm/unistd.h b/arch/h8300/include/asm/unistd.h index 07afcfaec995..c2c2f5c7d6bf 100644 --- a/arch/h8300/include/asm/unistd.h +++ b/arch/h8300/include/asm/unistd.h | |||
@@ -357,6 +357,9 @@ | |||
357 | #define __ARCH_WANT_SYS_RT_SIGACTION | 357 | #define __ARCH_WANT_SYS_RT_SIGACTION |
358 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 358 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
359 | #define __ARCH_WANT_SYS_EXECVE | 359 | #define __ARCH_WANT_SYS_EXECVE |
360 | #define __ARCH_WANT_SYS_FORK | ||
361 | #define __ARCH_WANT_SYS_VFORK | ||
362 | #define __ARCH_WANT_SYS_CLONE | ||
360 | 363 | ||
361 | /* | 364 | /* |
362 | * "Conditional" syscalls | 365 | * "Conditional" syscalls |
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index 2a45718cc5e8..b0fb4054aee5 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
@@ -127,40 +127,9 @@ void flush_thread(void) | |||
127 | { | 127 | { |
128 | } | 128 | } |
129 | 129 | ||
130 | /* | ||
131 | * "h8300_fork()".. By the time we get here, the | ||
132 | * non-volatile registers have also been saved on the | ||
133 | * stack. We do some ugly pointer stuff here.. (see | ||
134 | * also copy_thread) | ||
135 | */ | ||
136 | |||
137 | asmlinkage int h8300_fork(struct pt_regs *regs) | ||
138 | { | ||
139 | return -EINVAL; | ||
140 | } | ||
141 | |||
142 | asmlinkage int h8300_vfork(struct pt_regs *regs) | ||
143 | { | ||
144 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), regs, 0, NULL, NULL); | ||
145 | } | ||
146 | |||
147 | asmlinkage int h8300_clone(struct pt_regs *regs) | ||
148 | { | ||
149 | unsigned long clone_flags; | ||
150 | unsigned long newsp; | ||
151 | |||
152 | /* syscall2 puts clone_flags in er1 and usp in er2 */ | ||
153 | clone_flags = regs->er1; | ||
154 | newsp = regs->er2; | ||
155 | if (!newsp) | ||
156 | newsp = rdusp(); | ||
157 | return do_fork(clone_flags, newsp, regs, 0, NULL, NULL); | ||
158 | |||
159 | } | ||
160 | |||
161 | int copy_thread(unsigned long clone_flags, | 130 | int copy_thread(unsigned long clone_flags, |
162 | unsigned long usp, unsigned long topstk, | 131 | unsigned long usp, unsigned long topstk, |
163 | struct task_struct * p, struct pt_regs * regs) | 132 | struct task_struct * p, struct pt_regs *unused) |
164 | { | 133 | { |
165 | struct pt_regs * childregs; | 134 | struct pt_regs * childregs; |
166 | 135 | ||
@@ -173,11 +142,10 @@ int copy_thread(unsigned long clone_flags, | |||
173 | childregs->er5 = usp; /* fn */ | 142 | childregs->er5 = usp; /* fn */ |
174 | p->thread.ksp = (unsigned long)childregs; | 143 | p->thread.ksp = (unsigned long)childregs; |
175 | } | 144 | } |
176 | *childregs = *regs; | 145 | *childregs = *current_pt_regs(); |
177 | childregs->retpc = (unsigned long) ret_from_fork; | 146 | childregs->retpc = (unsigned long) ret_from_fork; |
178 | childregs->er0 = 0; | 147 | childregs->er0 = 0; |
179 | 148 | p->thread.usp = usp ?: rdusp(); | |
180 | p->thread.usp = usp; | ||
181 | p->thread.ksp = (unsigned long)childregs; | 149 | p->thread.ksp = (unsigned long)childregs; |
182 | 150 | ||
183 | return 0; | 151 | return 0; |
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index 9d77e715a2ed..b74dd0ade58d 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S | |||
@@ -340,21 +340,12 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
340 | bra SYMBOL_NAME(syscall_trampoline):8 | 340 | bra SYMBOL_NAME(syscall_trampoline):8 |
341 | .endm | 341 | .endm |
342 | 342 | ||
343 | SYMBOL_NAME_LABEL(sys_clone) | ||
344 | call_sp h8300_clone | ||
345 | |||
346 | SYMBOL_NAME_LABEL(sys_sigreturn) | 343 | SYMBOL_NAME_LABEL(sys_sigreturn) |
347 | call_sp do_sigreturn | 344 | call_sp do_sigreturn |
348 | 345 | ||
349 | SYMBOL_NAME_LABEL(sys_rt_sigreturn) | 346 | SYMBOL_NAME_LABEL(sys_rt_sigreturn) |
350 | call_sp do_rt_sigreturn | 347 | call_sp do_rt_sigreturn |
351 | 348 | ||
352 | SYMBOL_NAME_LABEL(sys_fork) | ||
353 | call_sp h8300_fork | ||
354 | |||
355 | SYMBOL_NAME_LABEL(sys_vfork) | ||
356 | call_sp h8300_vfork | ||
357 | |||
358 | SYMBOL_NAME_LABEL(syscall_trampoline) | 349 | SYMBOL_NAME_LABEL(syscall_trampoline) |
359 | mov.l sp,er0 | 350 | mov.l sp,er0 |
360 | jmp @er6 | 351 | jmp @er6 |