Patchwork [1/2] ppc: tcg: add nap insn support

login
register
mail settings
Submitter pingfan liu
Date Jan. 6, 2014, 12:56 a.m.
Message ID <1388969791-4752-1-git-send-email-pingfank@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/307074/
State New
Headers show

Comments

pingfan liu - Jan. 6, 2014, 12:56 a.m.
Add the emulation of insn "nap" for hypervisor

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
 target-ppc/excp_helper.c | 4 ++++
 target-ppc/helper.h      | 1 +
 target-ppc/translate.c   | 6 ++++++
 3 files changed, 11 insertions(+)

Patch

diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
index c959460..a9712bc 100644
--- a/target-ppc/excp_helper.c
+++ b/target-ppc/excp_helper.c
@@ -889,6 +889,10 @@  void helper_hrfid(CPUPPCState *env)
     do_rfi(env, env->spr[SPR_HSRR0], env->spr[SPR_HSRR1],
            ~((target_ulong)0x783F0000), 0);
 }
+
+void helper_nap(CPUPPCState *env)
+{
+}
 #endif
 
 /*****************************************************************************/
diff --git a/target-ppc/helper.h b/target-ppc/helper.h
index 6d282bb..87873db 100644
--- a/target-ppc/helper.h
+++ b/target-ppc/helper.h
@@ -17,6 +17,7 @@  DEF_HELPER_1(rfmci, void, env)
 #if defined(TARGET_PPC64)
 DEF_HELPER_1(rfid, void, env)
 DEF_HELPER_1(hrfid, void, env)
+DEF_HELPER_1(nap, void, env)
 #endif
 #endif
 
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 66c7771..ce63783 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3798,6 +3798,11 @@  static void gen_hrfid(DisasContext *ctx)
     gen_sync_exception(ctx);
 #endif
 }
+
+static void gen_nap(DisasContext *ctx)
+{
+    gen_helper_nap(cpu_env);
+}
 #endif
 
 /* sc */
@@ -8732,6 +8737,7 @@  GEN_HANDLER(rfi, 0x13, 0x12, 0x01, 0x03FF8001, PPC_FLOW),
 #if defined(TARGET_PPC64)
 GEN_HANDLER(rfid, 0x13, 0x12, 0x00, 0x03FF8001, PPC_64B),
 GEN_HANDLER(hrfid, 0x13, 0x12, 0x08, 0x03FF8001, PPC_64H),
+GEN_HANDLER(nap, 0x13, 0x12, 0x0d, 0x03FF8001, PPC_64H),
 #endif
 GEN_HANDLER(sc, 0x11, 0xFF, 0xFF, 0x03FFF01D, PPC_FLOW),
 GEN_HANDLER(tw, 0x1F, 0x04, 0x00, 0x00000001, PPC_FLOW),