Skip to content

Commit 3416e80

Browse files
author
Al Viro
committed
h8300: switch to generic fork/vfork/clone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent e9eac30 commit 3416e80

3 files changed

Lines changed: 6 additions & 44 deletions

File tree

‎arch/h8300/include/asm/unistd.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@
357357
#define __ARCH_WANT_SYS_RT_SIGACTION
358358
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
359359
#define __ARCH_WANT_SYS_EXECVE
360+
#define __ARCH_WANT_SYS_FORK
361+
#define __ARCH_WANT_SYS_VFORK
362+
#define __ARCH_WANT_SYS_CLONE
360363

361364
/*
362365
* "Conditional" syscalls

‎arch/h8300/kernel/process.c‎

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -127,40 +127,9 @@ void flush_thread(void)
127127
{
128128
}
129129

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-
161130
int copy_thread(unsigned long clone_flags,
162131
unsigned long usp, unsigned long topstk,
163-
struct task_struct * p, struct pt_regs * regs)
132+
struct task_struct * p, struct pt_regs *unused)
164133
{
165134
struct pt_regs * childregs;
166135

@@ -173,11 +142,10 @@ int copy_thread(unsigned long clone_flags,
173142
childregs->er5 = usp; /* fn */
174143
p->thread.ksp = (unsigned long)childregs;
175144
}
176-
*childregs = *regs;
145+
*childregs = *current_pt_regs();
177146
childregs->retpc = (unsigned long) ret_from_fork;
178147
childregs->er0 = 0;
179-
180-
p->thread.usp = usp;
148+
p->thread.usp = usp ?: rdusp();
181149
p->thread.ksp = (unsigned long)childregs;
182150

183151
return 0;

‎arch/h8300/kernel/syscalls.S‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,21 +340,12 @@ SYMBOL_NAME_LABEL(sys_call_table)
340340
bra SYMBOL_NAME(syscall_trampoline):8
341341
.endm
342342

343-
SYMBOL_NAME_LABEL(sys_clone)
344-
call_sp h8300_clone
345-
346343
SYMBOL_NAME_LABEL(sys_sigreturn)
347344
call_sp do_sigreturn
348345

349346
SYMBOL_NAME_LABEL(sys_rt_sigreturn)
350347
call_sp do_rt_sigreturn
351348

352-
SYMBOL_NAME_LABEL(sys_fork)
353-
call_sp h8300_fork
354-
355-
SYMBOL_NAME_LABEL(sys_vfork)
356-
call_sp h8300_vfork
357-
358349
SYMBOL_NAME_LABEL(syscall_trampoline)
359350
mov.l sp,er0
360351
jmp @er6

0 commit comments

Comments
 (0)