Skip to content

Commit e1cc9d8

Browse files
Christian BraunerRich Felker
authored andcommitted
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]> Signed-off-by: Rich Felker <[email protected]>
1 parent 6dfdf67 commit e1cc9d8

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
@@ -29,6 +29,7 @@ config SUPERH
2929
select HAVE_ARCH_AUDITSYSCALL
3030
select HAVE_ARCH_KGDB
3131
select HAVE_ARCH_TRACEHOOK
32+
select HAVE_COPY_THREAD_TLS
3233
select HAVE_DEBUG_BUGVERBOSE
3334
select HAVE_DEBUG_KMEMLEAK
3435
select HAVE_DYNAMIC_FTRACE

arch/sh/kernel/process_32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ EXPORT_SYMBOL(dump_fpu);
111111
asmlinkage void ret_from_fork(void);
112112
asmlinkage void ret_from_kernel_thread(void);
113113

114-
int copy_thread(unsigned long clone_flags, unsigned long usp,
115-
unsigned long arg, struct task_struct *p)
114+
int copy_thread_tls(unsigned long clone_flags, unsigned long usp,
115+
unsigned long arg, struct task_struct *p, unsigned long tls)
116116
{
117117
struct thread_info *ti = task_thread_info(p);
118118
struct pt_regs *childregs;
@@ -154,7 +154,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
154154
ti->addr_limit = USER_DS;
155155

156156
if (clone_flags & CLONE_SETTLS)
157-
childregs->gbr = childregs->regs[0];
157+
childregs->gbr = tls;
158158

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

0 commit comments

Comments
 (0)