summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/idle_book3e.S
diff options
context:
space:
mode:
authorStuart Yoder <stuart.yoder@freescale.com>2013-02-08 20:22:56 +0100
committerKumar Gala <galak@kernel.crashing.org>2013-03-13 20:19:36 +0100
commitf070986a07e514e3b4fc4aef6551b8dffcb19287 (patch)
tree83f92ecf55682267346574250f5cfba092064263 /arch/powerpc/kernel/idle_book3e.S
parentpowerpc/85xx: add CONFIG_E1000E to corenet64_smp_defconfig (diff)
downloadlinux-f070986a07e514e3b4fc4aef6551b8dffcb19287.tar.xz
linux-f070986a07e514e3b4fc4aef6551b8dffcb19287.zip
powerpc: Add paravirt idle loop for 64-bit Book-E
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/idle_book3e.S')
-rw-r--r--arch/powerpc/kernel/idle_book3e.S32
1 files changed, 30 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/idle_book3e.S b/arch/powerpc/kernel/idle_book3e.S
index 4c7cb4008585..bfb73cc209ce 100644
--- a/arch/powerpc/kernel/idle_book3e.S
+++ b/arch/powerpc/kernel/idle_book3e.S
@@ -16,11 +16,13 @@
#include <asm/ppc-opcode.h>
#include <asm/processor.h>
#include <asm/thread_info.h>
+#include <asm/epapr_hcalls.h>
/* 64-bit version only for now */
#ifdef CONFIG_PPC64
-_GLOBAL(book3e_idle)
+.macro BOOK3E_IDLE name loop
+_GLOBAL(\name)
/* Save LR for later */
mflr r0
std r0,16(r1)
@@ -67,7 +69,33 @@ _GLOBAL(book3e_idle)
/* We can now re-enable hard interrupts and go to sleep */
wrteei 1
-1: PPC_WAIT(0)
+ \loop
+
+.endm
+
+.macro BOOK3E_IDLE_LOOP
+1:
+ PPC_WAIT(0)
b 1b
+.endm
+
+/* epapr_ev_idle_start below is patched with the proper hcall
+ opcodes during kernel initialization */
+.macro EPAPR_EV_IDLE_LOOP
+idle_loop:
+ LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
+
+.global epapr_ev_idle_start
+epapr_ev_idle_start:
+ li r3, -1
+ nop
+ nop
+ nop
+ b idle_loop
+.endm
+
+BOOK3E_IDLE epapr_ev_idle EPAPR_EV_IDLE_LOOP
+
+BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP
#endif /* CONFIG_PPC64 */