static int ppc_hash32_get_physical_address(CPUPPCState *env, struct mmu_ctx_hash32 *ctx,

                                           target_ulong eaddr, int rw,

                                           int access_type)

{

    bool real_mode = (access_type == ACCESS_CODE && msr_ir == 0)

        || (access_type != ACCESS_CODE && msr_dr == 0);



    if (real_mode) {

        ctx->raddr = eaddr;

        ctx->prot = PAGE_READ | PAGE_EXEC | PAGE_WRITE;

        return 0;

    } else {

        int ret = -1;



        /* Try to find a BAT */

        if (env->nb_BATs != 0) {

            ret = ppc_hash32_get_bat(env, ctx, eaddr, rw, access_type);

        }

        if (ret < 0) {

            /* We didn't match any BAT entry or don't have BATs */

            ret = get_segment32(env, ctx, eaddr, rw, access_type);

        }

        return ret;

    }

}

static int ppc_hash32_get_physical_address(CPUPPCState *env, struct mmu_ctx_hash32 *ctx,

                                           target_ulong eaddr, int rw,

                                           int access_type)

{

    bool real_mode = (access_type == ACCESS_CODE && msr_ir == 0)

        || (access_type != ACCESS_CODE && msr_dr == 0);



    if (real_mode) {

        ctx->raddr = eaddr;

        ctx->prot = PAGE_READ | PAGE_EXEC | PAGE_WRITE;

        return 0;

    } else {

        int ret = -1;



        

        if (env->nb_BATs != 0) {

            ret = ppc_hash32_get_bat(env, ctx, eaddr, rw, access_type);

        }

        if (ret < 0) {

            

            ret = get_segment32(env, ctx, eaddr, rw, access_type);

        }

        return ret;

    }

}

static int FUNC_0(CPUPPCState *VAR_0, struct mmu_ctx_hash32 *VAR_1,

                                           target_ulong VAR_2, int VAR_3,

                                           int VAR_4)

{

    bool real_mode = (VAR_4 == ACCESS_CODE && msr_ir == 0)

        || (VAR_4 != ACCESS_CODE && msr_dr == 0);



    if (real_mode) {

        VAR_1->raddr = VAR_2;

        VAR_1->prot = PAGE_READ | PAGE_EXEC | PAGE_WRITE;

        return 0;

    } else {

        int VAR_5 = -1;



        

        if (VAR_0->nb_BATs != 0) {

            VAR_5 = ppc_hash32_get_bat(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4);

        }

        if (VAR_5 < 0) {

            

            VAR_5 = get_segment32(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4);

        }

        return VAR_5;

    }

}

static int FUNC_0(CPUPPCState *VAR_0, struct mmu_ctx_hash32 *VAR_1,
target_ulong VAR_2, int VAR_3,
int VAR_4)
{ bool real_mode = (VAR_4 == ACCESS_CODE && msr_ir == 0)
|| (VAR_4 != ACCESS_CODE && msr_dr == 0); if (real_mode) { VAR_1->raddr = VAR_2; VAR_1->prot = PAGE_READ | PAGE_EXEC | PAGE_WRITE; return 0; } else { int VAR_5 = -1; if (VAR_0->nb_BATs != 0) { VAR_5 = ppc_hash32_get_bat(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4); } if (VAR_5 < 0) { VAR_5 = get_segment32(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4); } return VAR_5; } }