aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2009-09-16 20:25:05 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-09-17 14:07:49 -0400
commitf4c6b6bc5a4fc8d607f2d89369008c85a3a12a8b (patch)
treebfcde115df6f7712b3c3356d608ae3a29c01a7c9 /arch/mips
parent6eb10bc9e2deab06630261cd05c4cb1e9a60e980 (diff)
MIPS: Consolidate all CONFIG_CPU_HAS_LLSC use in a single C file.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/system.h12
-rw-r--r--arch/mips/kernel/octeon_switch.S3
-rw-r--r--arch/mips/kernel/r2300_switch.S3
-rw-r--r--arch/mips/kernel/r4k_switch.S3
4 files changed, 12 insertions, 9 deletions
diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
index cd30f83235bb..a2e9239b45aa 100644
--- a/arch/mips/include/asm/system.h
+++ b/arch/mips/include/asm/system.h
@@ -63,11 +63,23 @@ do { \
63#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0) 63#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0)
64#endif 64#endif
65 65
66#ifdef CONFIG_CPU_HAS_LLSC
67#define __clear_software_ll_bit() do { } while (0)
68#else
69extern unsigned long ll_bit;
70
71#define __clear_software_ll_bit() \
72do { \
73 ll_bit = 0; \
74} while (0)
75#endif
76
66#define switch_to(prev, next, last) \ 77#define switch_to(prev, next, last) \
67do { \ 78do { \
68 __mips_mt_fpaff_switch_to(prev); \ 79 __mips_mt_fpaff_switch_to(prev); \
69 if (cpu_has_dsp) \ 80 if (cpu_has_dsp) \
70 __save_dsp(prev); \ 81 __save_dsp(prev); \
82 __clear_software_ll_bit(); \
71 (last) = resume(prev, next, task_thread_info(next)); \ 83 (last) = resume(prev, next, task_thread_info(next)); \
72} while (0) 84} while (0)
73 85
diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S
index d52389672b06..3952b8323efa 100644
--- a/arch/mips/kernel/octeon_switch.S
+++ b/arch/mips/kernel/octeon_switch.S
@@ -36,9 +36,6 @@
36 .align 7 36 .align 7
37 LEAF(resume) 37 LEAF(resume)
38 .set arch=octeon 38 .set arch=octeon
39#ifndef CONFIG_CPU_HAS_LLSC
40 sw zero, ll_bit
41#endif
42 mfc0 t1, CP0_STATUS 39 mfc0 t1, CP0_STATUS
43 LONG_S t1, THREAD_STATUS(a0) 40 LONG_S t1, THREAD_STATUS(a0)
44 cpu_save_nonscratch a0 41 cpu_save_nonscratch a0
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S
index 656bde2e11b1..698414b7a253 100644
--- a/arch/mips/kernel/r2300_switch.S
+++ b/arch/mips/kernel/r2300_switch.S
@@ -46,9 +46,6 @@
46 * struct thread_info *next_ti) ) 46 * struct thread_info *next_ti) )
47 */ 47 */
48LEAF(resume) 48LEAF(resume)
49#ifndef CONFIG_CPU_HAS_LLSC
50 sw zero, ll_bit
51#endif
52 mfc0 t1, CP0_STATUS 49 mfc0 t1, CP0_STATUS
53 sw t1, THREAD_STATUS(a0) 50 sw t1, THREAD_STATUS(a0)
54 cpu_save_nonscratch a0 51 cpu_save_nonscratch a0
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index d9bfae53c43f..8893ee1a2368 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -45,9 +45,6 @@
45 */ 45 */
46 .align 5 46 .align 5
47 LEAF(resume) 47 LEAF(resume)
48#ifndef CONFIG_CPU_HAS_LLSC
49 sw zero, ll_bit
50#endif
51 mfc0 t1, CP0_STATUS 48 mfc0 t1, CP0_STATUS
52 LONG_S t1, THREAD_STATUS(a0) 49 LONG_S t1, THREAD_STATUS(a0)
53 cpu_save_nonscratch a0 50 cpu_save_nonscratch a0