mirror of https://gitee.com/openkylin/linux.git
MIPS: Opt into HAVE_COPY_THREAD_TLS
This the mips version of commitc1bd55f922
("x86: opt into HAVE_COPY_THREAD_TLS, for both 32-bit and 64-bit"). Simply use the tls system call argument instead of extracting the tls argument by magic from the pt_regs structure. See commit3033f14ab7
("clone: support passing tls argument via C rather than pt_regs magic") for more background. Signed-off-by: James Cowgill <James.Cowgill@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/15855/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
759f534e93
commit
f9c4e3a6da
|
@ -70,6 +70,7 @@ config MIPS
|
||||||
select HAVE_EXIT_THREAD
|
select HAVE_EXIT_THREAD
|
||||||
select HAVE_REGS_AND_STACK_ACCESS_API
|
select HAVE_REGS_AND_STACK_ACCESS_API
|
||||||
select HAVE_ARCH_HARDENED_USERCOPY
|
select HAVE_ARCH_HARDENED_USERCOPY
|
||||||
|
select HAVE_COPY_THREAD_TLS
|
||||||
|
|
||||||
menu "Machine selection"
|
menu "Machine selection"
|
||||||
|
|
||||||
|
|
|
@ -114,8 +114,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
|
||||||
/*
|
/*
|
||||||
* Copy architecture-specific thread state
|
* Copy architecture-specific thread state
|
||||||
*/
|
*/
|
||||||
int copy_thread(unsigned long clone_flags, unsigned long usp,
|
int copy_thread_tls(unsigned long clone_flags, unsigned long usp,
|
||||||
unsigned long kthread_arg, struct task_struct *p)
|
unsigned long kthread_arg, struct task_struct *p, unsigned long tls)
|
||||||
{
|
{
|
||||||
struct thread_info *ti = task_thread_info(p);
|
struct thread_info *ti = task_thread_info(p);
|
||||||
struct pt_regs *childregs, *regs = current_pt_regs();
|
struct pt_regs *childregs, *regs = current_pt_regs();
|
||||||
|
@ -176,7 +176,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||||
atomic_set(&p->thread.bd_emu_frame, BD_EMUFRAME_NONE);
|
atomic_set(&p->thread.bd_emu_frame, BD_EMUFRAME_NONE);
|
||||||
|
|
||||||
if (clone_flags & CLONE_SETTLS)
|
if (clone_flags & CLONE_SETTLS)
|
||||||
ti->tp_value = regs->regs[7];
|
ti->tp_value = tls;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue