diff options
author | Stuart Yoder <stuart.yoder@freescale.com> | 2013-02-08 14:22:56 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2013-03-13 15:19:36 -0400 |
commit | f070986a07e514e3b4fc4aef6551b8dffcb19287 (patch) | |
tree | 83f92ecf55682267346574250f5cfba092064263 | |
parent | 19c29f1747b7fb8cbb4a4c4bca6357c60c43a61a (diff) |
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>
-rw-r--r-- | arch/powerpc/kernel/epapr_hcalls.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/idle_book3e.S | 32 |
2 files changed, 32 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/epapr_hcalls.S b/arch/powerpc/kernel/epapr_hcalls.S index 62c0dc237826..9f1ebf7338f1 100644 --- a/arch/powerpc/kernel/epapr_hcalls.S +++ b/arch/powerpc/kernel/epapr_hcalls.S | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/asm-compat.h> | 17 | #include <asm/asm-compat.h> |
18 | #include <asm/asm-offsets.h> | 18 | #include <asm/asm-offsets.h> |
19 | 19 | ||
20 | #ifndef CONFIG_PPC64 | ||
20 | /* epapr_ev_idle() was derived from e500_idle() */ | 21 | /* epapr_ev_idle() was derived from e500_idle() */ |
21 | _GLOBAL(epapr_ev_idle) | 22 | _GLOBAL(epapr_ev_idle) |
22 | CURRENT_THREAD_INFO(r3, r1) | 23 | CURRENT_THREAD_INFO(r3, r1) |
@@ -42,6 +43,7 @@ epapr_ev_idle_start: | |||
42 | * _TLF_NAPPING. | 43 | * _TLF_NAPPING. |
43 | */ | 44 | */ |
44 | b idle_loop | 45 | b idle_loop |
46 | #endif | ||
45 | 47 | ||
46 | /* Hypercall entry point. Will be patched with device tree instructions. */ | 48 | /* Hypercall entry point. Will be patched with device tree instructions. */ |
47 | .global epapr_hypercall_start | 49 | .global epapr_hypercall_start |
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 |
70 | 1: PPC_WAIT(0) | 72 | \loop |
73 | |||
74 | .endm | ||
75 | |||
76 | .macro BOOK3E_IDLE_LOOP | ||
77 | 1: | ||
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 | ||
85 | idle_loop: | ||
86 | LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE)) | ||
87 | |||
88 | .global epapr_ev_idle_start | ||
89 | epapr_ev_idle_start: | ||
90 | li r3, -1 | ||
91 | nop | ||
92 | nop | ||
93 | nop | ||
94 | b idle_loop | ||
95 | .endm | ||
96 | |||
97 | BOOK3E_IDLE epapr_ev_idle EPAPR_EV_IDLE_LOOP | ||
98 | |||
99 | BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP | ||
72 | 100 | ||
73 | #endif /* CONFIG_PPC64 */ | 101 | #endif /* CONFIG_PPC64 */ |