From 59191721a16ae393c01280dc633937374cdf474e Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 12 Mar 2013 00:31:15 +0000 Subject: target-ppc: Don't share get_pteg_offset() between 32 and 64-bit The get_pteg_offset() helper function is currently shared between 32-bit and 64-bit hash mmus, taking a parameter for the hash pte size. In the 64-bit paths, it's only called in one place, and it's a trivial calculation. This patch, therefore, open codes it for 64-bit. The remaining version, which is used in two places is made 32-bit only and moved to mmu-hash32.c. Signed-off-by: David Gibson Signed-off-by: Alexander Graf --- target-ppc/mmu-hash32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'target-ppc/mmu-hash32.c') diff --git a/target-ppc/mmu-hash32.c b/target-ppc/mmu-hash32.c index 4b7598bdfc..0ccaf7cf06 100644 --- a/target-ppc/mmu-hash32.c +++ b/target-ppc/mmu-hash32.c @@ -174,6 +174,11 @@ static int ppc_hash32_pte_update_flags(mmu_ctx_t *ctx, target_ulong *pte1p, return store; } +hwaddr get_pteg_offset32(CPUPPCState *env, hwaddr hash) +{ + return (hash * HASH_PTE_SIZE_32 * 8) & env->htab_mask; +} + /* PTE table lookup */ static int find_pte32(CPUPPCState *env, mmu_ctx_t *ctx, int h, int rw, int type, int target_page_bits) @@ -184,7 +189,7 @@ static int find_pte32(CPUPPCState *env, mmu_ctx_t *ctx, int h, int ret, r; ret = -1; /* No entry found */ - pteg_off = get_pteg_offset(env, ctx->hash[h], HASH_PTE_SIZE_32); + pteg_off = get_pteg_offset32(env, ctx->hash[h]); for (i = 0; i < 8; i++) { if (env->external_htab) { pte0 = ldl_p(env->external_htab + pteg_off + (i * 8)); -- cgit v1.2.3