diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-30 16:22:56 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-30 16:22:56 +0000 |
commit | 0f3955e2d28d71bc18935913e0bc2c5d134b1568 (patch) | |
tree | 47a019856ad6758c58c1fcbed74f0d72b93d42f4 /target-ppc | |
parent | 4bf5801db44a1bb13e80b35bb0ea7aeed9780050 (diff) |
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
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/helper.h | 7 | ||||
-rw-r--r-- | target-ppc/op.c | 28 | ||||
-rw-r--r-- | target-ppc/op_helper.c | 29 | ||||
-rw-r--r-- | target-ppc/op_helper.h | 2 | ||||
-rw-r--r-- | target-ppc/translate.c | 12 |
5 files changed, 36 insertions, 42 deletions
diff --git a/target-ppc/helper.h b/target-ppc/helper.h index be6c6a0fe7..67ba0142e3 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 5d2cfa1450..618bd3aa94 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 6addc7429a..1ea5a988df 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 1c046d87e9..5e36f573a4 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 95cb482662..083bf2878b 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 } |