aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--target-ppc/helper.h7
-rw-r--r--target-ppc/op.c28
-rw-r--r--target-ppc/op_helper.c29
-rw-r--r--target-ppc/op_helper.h2
-rw-r--r--target-ppc/translate.c12
5 files changed, 36 insertions, 42 deletions
diff --git a/target-ppc/helper.h b/target-ppc/helper.h
index be6c6a0fe..67ba0142e 100644
--- a/target-ppc/helper.h
+++ b/target-ppc/helper.h
@@ -139,4 +139,11 @@ DEF_HELPER_2(efdcmplt, i32, i64, i64)
DEF_HELPER_2(efdcmpgt, i32, i64, i64)
DEF_HELPER_2(efdcmpeq, i32, i64, i64)
+#if !defined(CONFIG_USER_ONLY)
+DEF_HELPER_1(load_6xx_tlbd, void, tl)
+DEF_HELPER_1(load_6xx_tlbi, void, tl)
+DEF_HELPER_1(load_74xx_tlbd, void, tl)
+DEF_HELPER_1(load_74xx_tlbi, void, tl)
+#endif
+
#include "def-helper.h"
diff --git a/target-ppc/op.c b/target-ppc/op.c
index 5d2cfa145..618bd3aa9 100644
--- a/target-ppc/op.c
+++ b/target-ppc/op.c
@@ -378,34 +378,6 @@ void OPPROTO op_slbie_64 (void)
#endif
#endif
-#if !defined(CONFIG_USER_ONLY)
-/* PowerPC 602/603/755 software TLB load instructions */
-void OPPROTO op_6xx_tlbld (void)
-{
- do_load_6xx_tlb(0);
- RETURN();
-}
-
-void OPPROTO op_6xx_tlbli (void)
-{
- do_load_6xx_tlb(1);
- RETURN();
-}
-
-/* PowerPC 74xx software TLB load instructions */
-void OPPROTO op_74xx_tlbld (void)
-{
- do_load_74xx_tlb(0);
- RETURN();
-}
-
-void OPPROTO op_74xx_tlbli (void)
-{
- do_load_74xx_tlb(1);
- RETURN();
-}
-#endif
-
/* 601 specific */
void OPPROTO op_load_601_rtcl (void)
{
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 6addc7429..1ea5a988d 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -2460,7 +2460,7 @@ void tlb_fill (target_ulong addr, int is_write, int mmu_idx, void *retaddr)
/* Software driven TLBs management */
/* PowerPC 602/603 software TLB load instructions helpers */
-void do_load_6xx_tlb (int is_code)
+static void helper_load_6xx_tlb (target_ulong new_EPN, int is_code)
{
target_ulong RPN, CMP, EPN;
int way;
@@ -2482,11 +2482,22 @@ void do_load_6xx_tlb (int is_code)
}
#endif
/* Store this TLB */
- ppc6xx_tlb_store(env, (uint32_t)(T0 & TARGET_PAGE_MASK),
+ ppc6xx_tlb_store(env, (uint32_t)(new_EPN & TARGET_PAGE_MASK),
way, is_code, CMP, RPN);
}
-void do_load_74xx_tlb (int is_code)
+void helper_load_6xx_tlbd (target_ulong EPN)
+{
+ helper_load_6xx_tlb(EPN, 0);
+}
+
+void helper_load_6xx_tlbi (target_ulong EPN)
+{
+ helper_load_6xx_tlb(EPN, 1);
+}
+
+/* PowerPC 74xx software TLB load instructions helpers */
+static void helper_load_74xx_tlb (target_ulong new_EPN, int is_code)
{
target_ulong RPN, CMP, EPN;
int way;
@@ -2503,10 +2514,20 @@ void do_load_74xx_tlb (int is_code)
}
#endif
/* Store this TLB */
- ppc6xx_tlb_store(env, (uint32_t)(T0 & TARGET_PAGE_MASK),
+ ppc6xx_tlb_store(env, (uint32_t)(new_EPN & TARGET_PAGE_MASK),
way, is_code, CMP, RPN);
}
+void helper_load_74xx_tlbd (target_ulong EPN)
+{
+ helper_load_74xx_tlb(EPN, 0);
+}
+
+void helper_load_74xx_tlbi (target_ulong EPN)
+{
+ helper_load_74xx_tlb(EPN, 1);
+}
+
static always_inline target_ulong booke_tlb_to_page_size (int size)
{
return 1024 << (2 * size);
diff --git a/target-ppc/op_helper.h b/target-ppc/op_helper.h
index 1c046d87e..5e36f573a 100644
--- a/target-ppc/op_helper.h
+++ b/target-ppc/op_helper.h
@@ -67,8 +67,6 @@ void do_rfi (void);
void do_rfid (void);
void do_hrfid (void);
#endif
-void do_load_6xx_tlb (int is_code);
-void do_load_74xx_tlb (int is_code);
#endif
/* POWER / PowerPC 601 specific helpers */
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 95cb48266..083bf2878 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -4965,8 +4965,7 @@ GEN_HANDLER2(tlbld_6xx, "tlbld", 0x1F, 0x12, 0x1E, 0x03FF0001, PPC_6xx_TLB)
GEN_EXCP_PRIVOPC(ctx);
return;
}
- tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]);
- gen_op_6xx_tlbld();
+ gen_helper_load_6xx_tlbd(cpu_gpr[rB(ctx->opcode)]);
#endif
}
@@ -4980,8 +4979,7 @@ GEN_HANDLER2(tlbli_6xx, "tlbli", 0x1F, 0x12, 0x1F, 0x03FF0001, PPC_6xx_TLB)
GEN_EXCP_PRIVOPC(ctx);
return;
}
- tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]);
- gen_op_6xx_tlbli();
+ gen_helper_load_6xx_tlbi(cpu_gpr[rB(ctx->opcode)]);
#endif
}
@@ -4996,8 +4994,7 @@ GEN_HANDLER2(tlbld_74xx, "tlbld", 0x1F, 0x12, 0x1E, 0x03FF0001, PPC_74xx_TLB)
GEN_EXCP_PRIVOPC(ctx);
return;
}
- tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]);
- gen_op_74xx_tlbld();
+ gen_helper_load_74xx_tlbd(cpu_gpr[rB(ctx->opcode)]);
#endif
}
@@ -5011,8 +5008,7 @@ GEN_HANDLER2(tlbli_74xx, "tlbli", 0x1F, 0x12, 0x1F, 0x03FF0001, PPC_74xx_TLB)
GEN_EXCP_PRIVOPC(ctx);
return;
}
- tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]);
- gen_op_74xx_tlbli();
+ gen_helper_load_74xx_tlbi(cpu_gpr[rB(ctx->opcode)]);
#endif
}