diff options
Diffstat (limited to 'arch/nios2/kernel/process.c')
-rw-r--r-- | arch/nios2/kernel/process.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/nios2/kernel/process.c b/arch/nios2/kernel/process.c index 509e7855e8dc..3dde4d6d8fbe 100644 --- a/arch/nios2/kernel/process.c +++ b/arch/nios2/kernel/process.c @@ -100,8 +100,8 @@ void flush_thread(void) { } -int copy_thread(unsigned long clone_flags, - unsigned long usp, unsigned long arg, struct task_struct *p) +int copy_thread_tls(unsigned long clone_flags, unsigned long usp, + unsigned long arg, struct task_struct *p, unsigned long tls) { struct pt_regs *childregs = task_pt_regs(p); struct pt_regs *regs; @@ -140,7 +140,7 @@ int copy_thread(unsigned long clone_flags, /* Initialize tls register. */ if (clone_flags & CLONE_SETTLS) - childstack->r23 = regs->r8; + childstack->r23 = tls; return 0; } @@ -259,3 +259,20 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r) { return 0; /* Nios2 has no FPU and thus no FPU registers */ } + +asmlinkage int nios2_clone(unsigned long clone_flags, unsigned long newsp, + int __user *parent_tidptr, int __user *child_tidptr, + unsigned long tls) +{ + struct kernel_clone_args args = { + .flags = (lower_32_bits(clone_flags) & ~CSIGNAL), + .pidfd = parent_tidptr, + .child_tid = child_tidptr, + .parent_tid = parent_tidptr, + .exit_signal = (lower_32_bits(clone_flags) & CSIGNAL), + .stack = newsp, + .tls = tls, + }; + + return _do_fork(&args); +} |