aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2013-05-21 11:33:32 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-05-21 19:34:28 -0400
commit087d990b371c59edbfc119600e2d2eda18366292 (patch)
tree43869914c4a0680a7b560576f7169c80354138f3 /arch/mips
parentf94d9a8ef9aebab5317d11fb1633ba14ad240983 (diff)
MIPS: Idle: Break r4k_wait into two functions and fix it.
local_irq_enable() may expand into very different code, so it rather should stay in C. Also this keeps the assembler code size constant which keeps the rollback code simple. So it's best to split r4k_wait into two parts, one C and one assembler. Finally add the local_irq_enable() to r4k_wait to ensure the WAIT instruction in __r4k_wait() will work properly. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/idle.h3
-rw-r--r--arch/mips/kernel/genex.S6
-rw-r--r--arch/mips/kernel/idle.c6
3 files changed, 11 insertions, 4 deletions
diff --git a/arch/mips/include/asm/idle.h b/arch/mips/include/asm/idle.h
index be6f807c1e3f..d192158886b1 100644
--- a/arch/mips/include/asm/idle.h
+++ b/arch/mips/include/asm/idle.h
@@ -4,7 +4,8 @@
4#include <linux/linkage.h> 4#include <linux/linkage.h>
5 5
6extern void (*cpu_wait)(void); 6extern void (*cpu_wait)(void);
7extern asmlinkage void r4k_wait(void); 7extern void r4k_wait(void);
8extern asmlinkage void __r4k_wait(void);
8extern void r4k_wait_irqoff(void); 9extern void r4k_wait_irqoff(void);
9extern void __pastwait(void); 10extern void __pastwait(void);
10 11
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 9098829bfcb0..31fa856829cb 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -122,7 +122,7 @@ handle_vcei:
122 __FINIT 122 __FINIT
123 123
124 .align 5 /* 32 byte rollback region */ 124 .align 5 /* 32 byte rollback region */
125LEAF(r4k_wait) 125LEAF(__r4k_wait)
126 .set push 126 .set push
127 .set noreorder 127 .set noreorder
128 /* start of rollback region */ 128 /* start of rollback region */
@@ -146,14 +146,14 @@ LEAF(r4k_wait)
146 jr ra 146 jr ra
147 nop 147 nop
148 .set pop 148 .set pop
149 END(r4k_wait) 149 END(__r4k_wait)
150 150
151 .macro BUILD_ROLLBACK_PROLOGUE handler 151 .macro BUILD_ROLLBACK_PROLOGUE handler
152 FEXPORT(rollback_\handler) 152 FEXPORT(rollback_\handler)
153 .set push 153 .set push
154 .set noat 154 .set noat
155 MFC0 k0, CP0_EPC 155 MFC0 k0, CP0_EPC
156 PTR_LA k1, r4k_wait 156 PTR_LA k1, __r4k_wait
157 ori k0, 0x1f /* 32 byte rollback region */ 157 ori k0, 0x1f /* 32 byte rollback region */
158 xori k0, 0x1f 158 xori k0, 0x1f
159 bne k0, k1, 9f 159 bne k0, k1, 9f
diff --git a/arch/mips/kernel/idle.c b/arch/mips/kernel/idle.c
index 985cc02786e3..3b09b888afa9 100644
--- a/arch/mips/kernel/idle.c
+++ b/arch/mips/kernel/idle.c
@@ -45,6 +45,12 @@ static void r39xx_wait(void)
45 local_irq_enable(); 45 local_irq_enable();
46} 46}
47 47
48void r4k_wait(void)
49{
50 local_irq_enable();
51 __r4k_wait();
52}
53
48/* 54/*
49 * This variant is preferable as it allows testing need_resched and going to 55 * This variant is preferable as it allows testing need_resched and going to
50 * sleep depending on the outcome atomically. Unfortunately the "It is 56 * sleep depending on the outcome atomically. Unfortunately the "It is