diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-17 10:35:37 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-02 16:23:28 -0500 |
commit | 7db44c75a241c18d03e82540c5b825216d4c668b (patch) | |
tree | ed60c9c5b8f894742ff5cfee278e542f5d8818b6 /arch | |
parent | c786282e6dd18fe2ff43ab44411085dc40e7fbc5 (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')
-rw-r--r-- | arch/arm/kernel/entry-header.S | 14 | ||||
-rw-r--r-- | arch/arm/mm/abort-ev6.S | 6 |
2 files changed, 10 insertions, 10 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 |
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index f332df7f0d37..1478aa522144 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S | |||
@@ -20,11 +20,11 @@ | |||
20 | */ | 20 | */ |
21 | .align 5 | 21 | .align 5 |
22 | ENTRY(v6_early_abort) | 22 | ENTRY(v6_early_abort) |
23 | #ifdef CONFIG_CPU_32v6K | 23 | #ifdef CONFIG_CPU_V6 |
24 | clrex | ||
25 | #else | ||
26 | sub r1, sp, #4 @ Get unused stack location | 24 | sub r1, sp, #4 @ Get unused stack location |
27 | strex r0, r1, [r1] @ Clear the exclusive monitor | 25 | strex r0, r1, [r1] @ Clear the exclusive monitor |
26 | #elif defined(CONFIG_CPU_32v6K) | ||
27 | clrex | ||
28 | #endif | 28 | #endif |
29 | mrc p15, 0, r1, c5, c0, 0 @ get FSR | 29 | mrc p15, 0, r1, c5, c0, 0 @ get FSR |
30 | mrc p15, 0, r0, c6, c0, 0 @ get FAR | 30 | mrc p15, 0, r0, c6, c0, 0 @ get FAR |