From d764f8dbccd27b602395e1ebe023ff48aa4c97ce Mon Sep 17 00:00:00 2001 From: Stuart Yoder Date: Fri, 8 Feb 2013 13:22:56 -0600 Subject: [PATCH] --- yaml --- r: 370845 b: refs/heads/master c: f070986a07e514e3b4fc4aef6551b8dffcb19287 h: refs/heads/master i: 370843: e5258a103e7fb1709b1bb8baf322e4698ec1d621 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/epapr_hcalls.S | 2 ++ trunk/arch/powerpc/kernel/idle_book3e.S | 32 ++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9c488a4100a4..72403bd28b8d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 19c29f1747b7fb8cbb4a4c4bca6357c60c43a61a +refs/heads/master: f070986a07e514e3b4fc4aef6551b8dffcb19287 diff --git a/trunk/arch/powerpc/kernel/epapr_hcalls.S b/trunk/arch/powerpc/kernel/epapr_hcalls.S index 62c0dc237826..9f1ebf7338f1 100644 --- a/trunk/arch/powerpc/kernel/epapr_hcalls.S +++ b/trunk/arch/powerpc/kernel/epapr_hcalls.S @@ -17,6 +17,7 @@ #include #include +#ifndef CONFIG_PPC64 /* epapr_ev_idle() was derived from e500_idle() */ _GLOBAL(epapr_ev_idle) CURRENT_THREAD_INFO(r3, r1) @@ -42,6 +43,7 @@ epapr_ev_idle_start: * _TLF_NAPPING. */ b idle_loop +#endif /* Hypercall entry point. Will be patched with device tree instructions. */ .global epapr_hypercall_start diff --git a/trunk/arch/powerpc/kernel/idle_book3e.S b/trunk/arch/powerpc/kernel/idle_book3e.S index 4c7cb4008585..bfb73cc209ce 100644 --- a/trunk/arch/powerpc/kernel/idle_book3e.S +++ b/trunk/arch/powerpc/kernel/idle_book3e.S @@ -16,11 +16,13 @@ #include #include #include +#include /* 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 */