[PATCH] ARM: 2663/1: straightify TLS register emulation a bit more
Patch from Nicolas Pitre This better express things, and should cover RMK's weird SMP toys. Signed-off-by: Nicolas Pitre Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:

committed by
Russell King

parent
f7e68bbf40
commit
4b0e07a556
@@ -451,9 +451,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
|
||||
|
||||
case NR(set_tls):
|
||||
thread->tp_value = regs->ARM_r0;
|
||||
#ifdef CONFIG_HAS_TLS_REG
|
||||
#if defined(CONFIG_HAS_TLS_REG)
|
||||
asm ("mcr p15, 0, %0, c13, c0, 3" : : "r" (regs->ARM_r0) );
|
||||
#else
|
||||
#elif !defined(CONFIG_TLS_REG_EMUL)
|
||||
/*
|
||||
* User space must never try to access this directly.
|
||||
* Expect your app to break eventually if you do so.
|
||||
@@ -498,11 +498,14 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_CPU_32v6) && !defined(CONFIG_HAS_TLS_REG)
|
||||
#ifdef CONFIG_TLS_REG_EMUL
|
||||
|
||||
/*
|
||||
* We might be running on an ARMv6+ processor which should have the TLS
|
||||
* register, but for some reason we can't use it and have to emulate it.
|
||||
* register but for some reason we can't use it, or maybe an SMP system
|
||||
* using a pre-ARMv6 processor (there are apparently a few prototypes like
|
||||
* that in existence) and therefore access to that register must be
|
||||
* emulated.
|
||||
*/
|
||||
|
||||
static int get_tp_trap(struct pt_regs *regs, unsigned int instr)
|
||||
|
Reference in New Issue
Block a user