aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/entry-header.S
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-01-17 10:35:37 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-02-02 16:23:28 -0500
commit7db44c75a241c18d03e82540c5b825216d4c668b (patch)
treeed60c9c5b8f894742ff5cfee278e542f5d8818b6 /arch/arm/kernel/entry-header.S
parentc786282e6dd18fe2ff43ab44411085dc40e7fbc5 (diff)
ARM: v6k: select clear exclusive code seqences according to V6 variants
If CONFIG_CPU_V6 is enabled, then the kernel must support ARMv6 CPUs which don't have the V6K extensions implemented. Always use the dummy store-exclusive method to ensure that the exclusive monitors are cleared. If CONFIG_CPU_V6 is not set, but CONFIG_CPU_32v6K is enabled, then we have the K extensions available on all CPUs we're building support for, so we can use the new clear-exclusive instruction. Acked-by: Tony Lindgren <tony@atomide.com> Tested-by: Sourav Poddar <sourav.poddar@ti.com> Tested-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/entry-header.S')
-rw-r--r--arch/arm/kernel/entry-header.S14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index ae9464900168..051166c2a932 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -76,13 +76,13 @@
76#ifndef CONFIG_THUMB2_KERNEL 76#ifndef CONFIG_THUMB2_KERNEL
77 .macro svc_exit, rpsr 77 .macro svc_exit, rpsr
78 msr spsr_cxsf, \rpsr 78 msr spsr_cxsf, \rpsr
79#if defined(CONFIG_CPU_32v6K) 79#if defined(CONFIG_CPU_V6)
80 clrex @ clear the exclusive monitor
81 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
82#elif defined (CONFIG_CPU_V6)
83 ldr r0, [sp] 80 ldr r0, [sp]
84 strex r1, r2, [sp] @ clear the exclusive monitor 81 strex r1, r2, [sp] @ clear the exclusive monitor
85 ldmib sp, {r1 - pc}^ @ load r1 - pc, cpsr 82 ldmib sp, {r1 - pc}^ @ load r1 - pc, cpsr
83#elif defined(CONFIG_CPU_32v6K)
84 clrex @ clear the exclusive monitor
85 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
86#else 86#else
87 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 87 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
88#endif 88#endif
@@ -92,10 +92,10 @@
92 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr 92 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
93 ldr lr, [sp, #\offset + S_PC]! @ get pc 93 ldr lr, [sp, #\offset + S_PC]! @ get pc
94 msr spsr_cxsf, r1 @ save in spsr_svc 94 msr spsr_cxsf, r1 @ save in spsr_svc
95#if defined(CONFIG_CPU_32v6K) 95#if defined(CONFIG_CPU_V6)
96 clrex @ clear the exclusive monitor
97#elif defined (CONFIG_CPU_V6)
98 strex r1, r2, [sp] @ clear the exclusive monitor 96 strex r1, r2, [sp] @ clear the exclusive monitor
97#elif defined(CONFIG_CPU_32v6K)
98 clrex @ clear the exclusive monitor
99#endif 99#endif
100 .if \fast 100 .if \fast
101 ldmdb sp, {r1 - lr}^ @ get calling r1 - lr 101 ldmdb sp, {r1 - lr}^ @ get calling r1 - lr