aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/idle_book3e.S
diff options
context:
space:
mode:
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 @@
16#include <asm/ppc-opcode.h> 16#include <asm/ppc-opcode.h>
17#include <asm/processor.h> 17#include <asm/processor.h>
18#include <asm/thread_info.h> 18#include <asm/thread_info.h>
19#include <asm/epapr_hcalls.h>
19 20
20/* 64-bit version only for now */ 21/* 64-bit version only for now */
21#ifdef CONFIG_PPC64 22#ifdef CONFIG_PPC64
22 23
23_GLOBAL(book3e_idle) 24.macro BOOK3E_IDLE name loop
25_GLOBAL(\name)
24 /* Save LR for later */ 26 /* Save LR for later */
25 mflr r0 27 mflr r0
26 std r0,16(r1) 28 std r0,16(r1)
@@ -67,7 +69,33 @@ _GLOBAL(book3e_idle)
67 69
68 /* We can now re-enable hard interrupts and go to sleep */ 70 /* We can now re-enable hard interrupts and go to sleep */
69 wrteei 1 71 wrteei 1
701: PPC_WAIT(0) 72 \loop
73
74.endm
75
76.macro BOOK3E_IDLE_LOOP
771:
78 PPC_WAIT(0)
71 b 1b 79 b 1b
80.endm
81
82/* epapr_ev_idle_start below is patched with the proper hcall
83 opcodes during kernel initialization */
84.macro EPAPR_EV_IDLE_LOOP
85idle_loop:
86 LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
87
88.global epapr_ev_idle_start
89epapr_ev_idle_start:
90 li r3, -1
91 nop
92 nop
93 nop
94 b idle_loop
95.endm
96
97BOOK3E_IDLE epapr_ev_idle EPAPR_EV_IDLE_LOOP
98
99BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP
72 100
73#endif /* CONFIG_PPC64 */ 101#endif /* CONFIG_PPC64 */