static int mmubooke206_get_physical_address(CPUState *env, mmu_ctx_t *ctx,

                                            target_ulong address, int rw,

                                            int access_type)

{

    ppcmas_tlb_t *tlb;

    target_phys_addr_t raddr;

    int i, j, ret;



    ret = -1;

    raddr = (target_phys_addr_t)-1ULL;



    for (i = 0; i < BOOKE206_MAX_TLBN; i++) {

        int ways = booke206_tlb_ways(env, i);



        for (j = 0; j < ways; j++) {

            tlb = booke206_get_tlbm(env, i, address, j);




            ret = mmubooke206_check_tlb(env, tlb, &raddr, &ctx->prot, address,

                                        rw, access_type);

            if (ret != -1) {

                goto found_tlb;






found_tlb:



    if (ret >= 0) {

        ctx->raddr = raddr;

        LOG_SWTLB("%s: access granted " TARGET_FMT_lx " => " TARGET_FMT_plx

                  " %d %d\n", __func__, address, ctx->raddr, ctx->prot,

                  ret);

    } else {

        LOG_SWTLB("%s: access refused " TARGET_FMT_lx " => " TARGET_FMT_plx

                  " %d %d\n", __func__, address, raddr, ctx->prot, ret);




    return ret;

static int mmubooke206_get_physical_address(CPUState *env, mmu_ctx_t *ctx,

                                            target_ulong address, int rw,

                                            int access_type)

{

    ppcmas_tlb_t *tlb;

    target_phys_addr_t raddr;

    int i, j, ret;



    ret = -1;

    raddr = (target_phys_addr_t)-1ULL;



    for (i = 0; i < BOOKE206_MAX_TLBN; i++) {

        int ways = booke206_tlb_ways(env, i);



        for (j = 0; j < ways; j++) {

            tlb = booke206_get_tlbm(env, i, address, j);




            ret = mmubooke206_check_tlb(env, tlb, &raddr, &ctx->prot, address,

                                        rw, access_type);

            if (ret != -1) {

                goto found_tlb;






found_tlb:



    if (ret >= 0) {

        ctx->raddr = raddr;

        LOG_SWTLB("%s: access granted " TARGET_FMT_lx " => " TARGET_FMT_plx

                  " %d %d\n", __func__, address, ctx->raddr, ctx->prot,

                  ret);

    } else {

        LOG_SWTLB("%s: access refused " TARGET_FMT_lx " => " TARGET_FMT_plx

                  " %d %d\n", __func__, address, raddr, ctx->prot, ret);




    return ret;

static int FUNC_0(CPUState *VAR_0, mmu_ctx_t *VAR_1,

                                            target_ulong VAR_2, int VAR_3,

                                            int VAR_4)

{

    ppcmas_tlb_t *tlb;

    target_phys_addr_t raddr;

    int VAR_5, VAR_6, VAR_7;



    VAR_7 = -1;

    raddr = (target_phys_addr_t)-1ULL;



    for (VAR_5 = 0; VAR_5 < BOOKE206_MAX_TLBN; VAR_5++) {

        int ways = booke206_tlb_ways(VAR_0, VAR_5);



        for (VAR_6 = 0; VAR_6 < ways; VAR_6++) {

            tlb = booke206_get_tlbm(VAR_0, VAR_5, VAR_2, VAR_6);




            VAR_7 = mmubooke206_check_tlb(VAR_0, tlb, &raddr, &VAR_1->prot, VAR_2,

                                        VAR_3, VAR_4);

            if (VAR_7 != -1) {

                goto found_tlb;






found_tlb:



    if (VAR_7 >= 0) {

        VAR_1->raddr = raddr;

        LOG_SWTLB("%s: access granted " TARGET_FMT_lx " => " TARGET_FMT_plx

                  " %d %d\n", __func__, VAR_2, VAR_1->raddr, VAR_1->prot,

                  VAR_7);

    } else {

        LOG_SWTLB("%s: access refused " TARGET_FMT_lx " => " TARGET_FMT_plx

                  " %d %d\n", __func__, VAR_2, raddr, VAR_1->prot, VAR_7);




    return VAR_7;

static int FUNC_0(CPUState *VAR_0, mmu_ctx_t *VAR_1,
target_ulong VAR_2, int VAR_3,
int VAR_4)
{ ppcmas_tlb_t *tlb; target_phys_addr_t raddr; int VAR_5, VAR_6, VAR_7; VAR_7 = -1; raddr = (target_phys_addr_t)-1ULL; for (VAR_5 = 0; VAR_5 < BOOKE206_MAX_TLBN; VAR_5++) { int ways = booke206_tlb_ways(VAR_0, VAR_5); for (VAR_6 = 0; VAR_6 < ways; VAR_6++) { tlb = booke206_get_tlbm(VAR_0, VAR_5, VAR_2, VAR_6); VAR_7 = mmubooke206_check_tlb(VAR_0, tlb, &raddr, &VAR_1->prot, VAR_2,
VAR_3, VAR_4); if (VAR_7 != -1) { goto found_tlb; found_tlb:
if (VAR_7 >= 0) { VAR_1->raddr = raddr; LOG_SWTLB("%s: access granted " TARGET_FMT_lx " => " TARGET_FMT_plx
" %d %d\n", __func__, VAR_2, VAR_1->raddr, VAR_1->prot,
VAR_7); } else { LOG_SWTLB("%s: access refused " TARGET_FMT_lx " => " TARGET_FMT_plx
" %d %d\n", __func__, VAR_2, raddr, VAR_1->prot, VAR_7); return VAR_7;