Commit 0b9f386c authored by Guo Ren's avatar Guo Ren

csky: Implement copy_thread_tls

This is required for clone3 which passes the TLS value through a
struct rather than a register.

Cc: Amanieu d'Antras <amanieu@gmail.com>
Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
parent 5b49c82d
...@@ -36,6 +36,7 @@ config CSKY ...@@ -36,6 +36,7 @@ config CSKY
select GX6605S_TIMER if CPU_CK610 select GX6605S_TIMER if CPU_CK610
select HAVE_ARCH_TRACEHOOK select HAVE_ARCH_TRACEHOOK
select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_AUDITSYSCALL
select HAVE_COPY_THREAD_TLS
select HAVE_DYNAMIC_FTRACE select HAVE_DYNAMIC_FTRACE
select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_GRAPH_TRACER select HAVE_FUNCTION_GRAPH_TRACER
......
...@@ -40,10 +40,11 @@ unsigned long thread_saved_pc(struct task_struct *tsk) ...@@ -40,10 +40,11 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
return sw->r15; return sw->r15;
} }
int copy_thread(unsigned long clone_flags, int copy_thread_tls(unsigned long clone_flags,
unsigned long usp, unsigned long usp,
unsigned long kthread_arg, unsigned long kthread_arg,
struct task_struct *p) struct task_struct *p,
unsigned long tls)
{ {
struct switch_stack *childstack; struct switch_stack *childstack;
struct pt_regs *childregs = task_pt_regs(p); struct pt_regs *childregs = task_pt_regs(p);
...@@ -70,7 +71,7 @@ int copy_thread(unsigned long clone_flags, ...@@ -70,7 +71,7 @@ int copy_thread(unsigned long clone_flags,
childregs->usp = usp; childregs->usp = usp;
if (clone_flags & CLONE_SETTLS) if (clone_flags & CLONE_SETTLS)
task_thread_info(p)->tp_value = childregs->tls task_thread_info(p)->tp_value = childregs->tls
= childregs->regs[0]; = tls;
childregs->a0 = 0; childregs->a0 = 0;
childstack->r15 = (unsigned long) ret_from_fork; childstack->r15 = (unsigned long) ret_from_fork;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment