diff options
author | Amanieu d'Antras <amanieu@gmail.com> | 2020-01-02 18:24:11 +0100 |
---|---|---|
committer | Christian Brauner <christian.brauner@ubuntu.com> | 2020-01-07 13:31:23 +0100 |
commit | 20bda4ed62f507ed72e30e817b43c65fdba60be7 (patch) | |
tree | 5ccc07a7b082c184f4b1a76b2243775df0bb8d62 /arch/riscv/kernel/process.c | |
parent | d2f36c787b2181561d8b95814f8cdad64b348ad7 (diff) | |
download | linux-20bda4ed62f507ed72e30e817b43c65fdba60be7.tar.gz |
riscv: Implement copy_thread_tls
This is required for clone3 which passes the TLS value through a
struct rather than a register.
Signed-off-by: Amanieu d'Antras <amanieu@gmail.com>
Cc: linux-riscv@lists.infradead.org
Cc: <stable@vger.kernel.org> # 5.3.x
Link: https://lore.kernel.org/r/20200102172413.654385-6-amanieu@gmail.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Diffstat (limited to 'arch/riscv/kernel/process.c')
-rw-r--r-- | arch/riscv/kernel/process.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 95a3031e5c7c..817cf7b0974c 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -99,8 +99,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) return 0; } -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); @@ -121,7 +121,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, if (usp) /* User fork */ childregs->sp = usp; if (clone_flags & CLONE_SETTLS) - childregs->tp = childregs->a5; + childregs->tp = tls; childregs->a0 = 0; /* Return value of fork() */ p->thread.ra = (unsigned long)ret_from_fork; } |