Skip to content

Commit 0b9f386

Browse files
committed
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 <[email protected]> Signed-off-by: Guo Ren <[email protected]>
1 parent 5b49c82 commit 0b9f386

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

arch/csky/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ config CSKY
3636
select GX6605S_TIMER if CPU_CK610
3737
select HAVE_ARCH_TRACEHOOK
3838
select HAVE_ARCH_AUDITSYSCALL
39+
select HAVE_COPY_THREAD_TLS
3940
select HAVE_DYNAMIC_FTRACE
4041
select HAVE_FUNCTION_TRACER
4142
select HAVE_FUNCTION_GRAPH_TRACER

arch/csky/kernel/process.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
4040
return sw->r15;
4141
}
4242

43-
int copy_thread(unsigned long clone_flags,
43+
int copy_thread_tls(unsigned long clone_flags,
4444
unsigned long usp,
4545
unsigned long kthread_arg,
46-
struct task_struct *p)
46+
struct task_struct *p,
47+
unsigned long tls)
4748
{
4849
struct switch_stack *childstack;
4950
struct pt_regs *childregs = task_pt_regs(p);
@@ -70,7 +71,7 @@ int copy_thread(unsigned long clone_flags,
7071
childregs->usp = usp;
7172
if (clone_flags & CLONE_SETTLS)
7273
task_thread_info(p)->tp_value = childregs->tls
73-
= childregs->regs[0];
74+
= tls;
7475

7576
childregs->a0 = 0;
7677
childstack->r15 = (unsigned long) ret_from_fork;

0 commit comments

Comments
 (0)