Skip to content

Commit 8496da0

Browse files
author
Christian Brauner
committed
unicore: switch to copy_thread_tls()
Use the copy_thread_tls() calling convention which passes tls through a register. This is required so we can remove the copy_thread{_tls}() split and remove the HAVE_COPY_THREAD_TLS macro. Cc: Guan Xuetao <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 15350c4 commit 8496da0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

arch/unicore32/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ config UNICORE32
2222
select MODULES_USE_ELF_REL
2323
select NEED_DMA_MAP_STATE
2424
select MMU_GATHER_NO_RANGE if MMU
25+
select HAVE_COPY_THREAD_TLS
2526
help
2627
UniCore-32 is 32-bit Instruction Set Architecture,
2728
including a series of low-power-consumption RISC chip

arch/unicore32/kernel/process.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ void release_thread(struct task_struct *dead_task)
219219
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
220220
asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread");
221221

222-
int
223-
copy_thread(unsigned long clone_flags, unsigned long stack_start,
224-
unsigned long stk_sz, struct task_struct *p)
222+
int copy_thread_tls(unsigned long clone_flags, unsigned long stack_start,
223+
unsigned long stk_sz, struct task_struct *p,
224+
unsigned long tls)
225225
{
226226
struct thread_info *thread = task_thread_info(p);
227227
struct pt_regs *childregs = task_pt_regs(p);
@@ -241,7 +241,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
241241
childregs->UCreg_sp = stack_start;
242242

243243
if (clone_flags & CLONE_SETTLS)
244-
childregs->UCreg_16 = childregs->UCreg_03;
244+
childregs->UCreg_16 = tls;
245245
}
246246
return 0;
247247
}

0 commit comments

Comments
 (0)