diff options
-rw-r--r-- | arch/h8300/Kconfig | 1 | ||||
-rw-r--r-- | arch/h8300/kernel/process.c | 18 |
2 files changed, 14 insertions, 5 deletions
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index d11666d538fe..de0eb417a0b9 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -26,6 +26,7 @@ config H8300 select HAVE_ARCH_HASH select CPU_NO_EFFICIENT_FFS select UACCESS_MEMCPY + select HAVE_COPY_THREAD_TLS config CPU_BIG_ENDIAN def_bool y diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index 0ef55e3052c9..ae23de4dcf42 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c @@ -105,9 +105,9 @@ void flush_thread(void) { } -int copy_thread(unsigned long clone_flags, - unsigned long usp, unsigned long topstk, - struct task_struct *p) +int copy_thread_tls(unsigned long clone_flags, unsigned long usp, + unsigned long topstk, struct task_struct *p, + unsigned long tls) { struct pt_regs *childregs; @@ -159,11 +159,19 @@ asmlinkage int sys_clone(unsigned long __user *args) unsigned long newsp; uintptr_t parent_tidptr; uintptr_t child_tidptr; + struct kernel_clone_args kargs = {}; get_user(clone_flags, &args[0]); get_user(newsp, &args[1]); get_user(parent_tidptr, &args[2]); get_user(child_tidptr, &args[3]); - return do_fork(clone_flags, newsp, 0, - (int __user *)parent_tidptr, (int __user *)child_tidptr); + + kargs.flags = (lower_32_bits(clone_flags) & ~CSIGNAL); + kargs.pidfd = (int __user *)parent_tidptr; + kargs.child_tid = (int __user *)child_tidptr; + kargs.parent_tid = (int __user *)parent_tidptr; + kargs.exit_signal = (lower_32_bits(clone_flags) & CSIGNAL); + kargs.stack = newsp; + + return _do_fork(&kargs); } |