target-ppc: convert software TLB instructions to TCG

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5819 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 6addc74..1ea5a98 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -2460,7 +2460,7 @@
 
 /* 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 @@
     }
 #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 @@
     }
 #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);