unicore32: switch to generic clone(2)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
eda9697702
commit
cb56217362
|
@ -13,3 +13,4 @@
|
||||||
/* Use the standard ABI for syscalls. */
|
/* Use the standard ABI for syscalls. */
|
||||||
#include <asm-generic/unistd.h>
|
#include <asm-generic/unistd.h>
|
||||||
#define __ARCH_WANT_SYS_EXECVE
|
#define __ARCH_WANT_SYS_EXECVE
|
||||||
|
#define __ARCH_WANT_SYS_CLONE
|
||||||
|
|
|
@ -668,12 +668,6 @@ __cr_alignment:
|
||||||
#endif
|
#endif
|
||||||
.ltorg
|
.ltorg
|
||||||
|
|
||||||
ENTRY(sys_clone)
|
|
||||||
add ip, sp, #S_OFF
|
|
||||||
stw ip, [sp+], #4
|
|
||||||
b __sys_clone
|
|
||||||
ENDPROC(sys_clone)
|
|
||||||
|
|
||||||
ENTRY(sys_rt_sigreturn)
|
ENTRY(sys_rt_sigreturn)
|
||||||
add r0, sp, #S_OFF
|
add r0, sp, #S_OFF
|
||||||
mov why, #0 @ prevent syscall restart handling
|
mov why, #0 @ prevent syscall restart handling
|
||||||
|
|
|
@ -262,26 +262,27 @@ asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread");
|
||||||
|
|
||||||
int
|
int
|
||||||
copy_thread(unsigned long clone_flags, unsigned long stack_start,
|
copy_thread(unsigned long clone_flags, unsigned long stack_start,
|
||||||
unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs)
|
unsigned long stk_sz, struct task_struct *p, struct pt_regs *unused)
|
||||||
{
|
{
|
||||||
struct thread_info *thread = task_thread_info(p);
|
struct thread_info *thread = task_thread_info(p);
|
||||||
struct pt_regs *childregs = task_pt_regs(p);
|
struct pt_regs *childregs = task_pt_regs(p);
|
||||||
|
|
||||||
memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
|
memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
|
||||||
thread->cpu_context.sp = (unsigned long)childregs;
|
thread->cpu_context.sp = (unsigned long)childregs;
|
||||||
if (unlikely(!regs)) {
|
if (unlikely(p->flags & PF_KTHREAD)) {
|
||||||
thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread;
|
thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread;
|
||||||
thread->cpu_context.r4 = stack_start;
|
thread->cpu_context.r4 = stack_start;
|
||||||
thread->cpu_context.r5 = stk_sz;
|
thread->cpu_context.r5 = stk_sz;
|
||||||
memset(childregs, 0, sizeof(struct pt_regs));
|
memset(childregs, 0, sizeof(struct pt_regs));
|
||||||
} else {
|
} else {
|
||||||
thread->cpu_context.pc = (unsigned long)ret_from_fork;
|
thread->cpu_context.pc = (unsigned long)ret_from_fork;
|
||||||
*childregs = *regs;
|
*childregs = *current_pt_regs();
|
||||||
childregs->UCreg_00 = 0;
|
childregs->UCreg_00 = 0;
|
||||||
childregs->UCreg_sp = stack_start;
|
if (stack_start)
|
||||||
|
childregs->UCreg_sp = stack_start;
|
||||||
|
|
||||||
if (clone_flags & CLONE_SETTLS)
|
if (clone_flags & CLONE_SETTLS)
|
||||||
childregs->UCreg_16 = regs->UCreg_03;
|
childregs->UCreg_16 = childregs->UCreg_03;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,20 +28,6 @@
|
||||||
#include <asm/syscalls.h>
|
#include <asm/syscalls.h>
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
|
|
||||||
/* Clone a task - this clones the calling program thread.
|
|
||||||
* This is called indirectly via a small wrapper
|
|
||||||
*/
|
|
||||||
asmlinkage long __sys_clone(unsigned long clone_flags, unsigned long newsp,
|
|
||||||
void __user *parent_tid, void __user *child_tid,
|
|
||||||
struct pt_regs *regs)
|
|
||||||
{
|
|
||||||
if (!newsp)
|
|
||||||
newsp = regs->UCreg_sp;
|
|
||||||
|
|
||||||
return do_fork(clone_flags, newsp, regs, 0,
|
|
||||||
parent_tid, child_tid);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Note: used by the compat code even in 64-bit Linux. */
|
/* Note: used by the compat code even in 64-bit Linux. */
|
||||||
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
|
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
|
||||||
unsigned long, prot, unsigned long, flags,
|
unsigned long, prot, unsigned long, flags,
|
||||||
|
|
Reference in New Issue