Skip to content

Commit 15350c4

Browse files
author
Christian Brauner
committed
sh: 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: Rich Felker <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 1dd966e commit 15350c4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

arch/sh/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ config SUPERH
7070
select ARCH_HIBERNATION_POSSIBLE if MMU
7171
select SPARSE_IRQ
7272
select HAVE_STACKPROTECTOR
73+
select HAVE_COPY_THREAD_TLS
7374
help
7475
The SuperH is a RISC processor targeted for use in embedded systems
7576
and consumer electronics; it was also used in the Sega Dreamcast

arch/sh/kernel/process_32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ EXPORT_SYMBOL(dump_fpu);
115115
asmlinkage void ret_from_fork(void);
116116
asmlinkage void ret_from_kernel_thread(void);
117117

118-
int copy_thread(unsigned long clone_flags, unsigned long usp,
119-
unsigned long arg, struct task_struct *p)
118+
int copy_thread_tls(unsigned long clone_flags, unsigned long usp,
119+
unsigned long arg, struct task_struct *p, unsigned long tls)
120120
{
121121
struct thread_info *ti = task_thread_info(p);
122122
struct pt_regs *childregs;
@@ -158,7 +158,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
158158
ti->addr_limit = USER_DS;
159159

160160
if (clone_flags & CLONE_SETTLS)
161-
childregs->gbr = childregs->regs[0];
161+
childregs->gbr = tls;
162162

163163
childregs->regs[0] = 0; /* Set return value for child */
164164
p->thread.pc = (unsigned long) ret_from_fork;

0 commit comments

Comments
 (0)