Skip to content

Commit

Permalink
openrisc: switch to use of generic fork and clone
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Nov 29, 2012
1 parent cb56217 commit 39d91a9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 66 deletions.
7 changes: 7 additions & 0 deletions arch/openrisc/include/asm/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,11 @@ asmlinkage long sys_or1k_atomic(unsigned long type, unsigned long *v1,

#include <asm-generic/syscalls.h>

asmlinkage long __sys_clone(unsigned long clone_flags, unsigned long newsp,
void __user *parent_tid, void __user *child_tid, int tls);
asmlinkage long __sys_fork(void);

#define sys_clone __sys_clone
#define sys_fork __sys_fork

#endif /* __ASM_OPENRISC_SYSCALLS_H */
2 changes: 2 additions & 0 deletions arch/openrisc/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#define sys_mmap2 sys_mmap_pgoff

#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_CLONE

#include <asm-generic/unistd.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/openrisc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extra-y := head.o vmlinux.lds

obj-y := setup.o idle.o or32_ksyms.o process.o dma.o \
traps.o time.o irq.o entry.o ptrace.o signal.o sys_or32.o \
traps.o time.o irq.o entry.o ptrace.o signal.o \
sys_call_table.o

obj-$(CONFIG_MODULES) += module.o
Expand Down
12 changes: 6 additions & 6 deletions arch/openrisc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1071,15 +1071,15 @@ _fork_save_extra_regs_and_call:
l.jr r29
l.sw PT_GPR28(r1),r28

ENTRY(sys_clone)
l.movhi r29,hi(_sys_clone)
l.ori r29,r29,lo(_sys_clone)
ENTRY(__sys_clone)
l.movhi r29,hi(sys_clone)
l.ori r29,r29,lo(sys_clone)
l.j _fork_save_extra_regs_and_call
l.addi r7,r1,0

ENTRY(sys_fork)
l.movhi r29,hi(_sys_fork)
l.ori r29,r29,lo(_sys_fork)
ENTRY(__sys_fork)
l.movhi r29,hi(sys_fork)
l.ori r29,r29,lo(sys_fork)
l.j _fork_save_extra_regs_and_call
l.addi r3,r1,0

Expand Down
5 changes: 3 additions & 2 deletions arch/openrisc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
kregs->gpr[20] = usp; /* fn, kernel thread */
kregs->gpr[22] = arg;
} else {
*userregs = *regs;
*userregs = *current_pt_regs();

userregs->sp = usp;
if (usp)
userregs->sp = usp;
userregs->gpr[11] = 0; /* Result from fork() */

kregs->gpr[20] = 0; /* Userspace thread */
Expand Down
57 changes: 0 additions & 57 deletions arch/openrisc/kernel/sys_or32.c

This file was deleted.

0 comments on commit 39d91a9

Please sign in to comment.