void tlb_fill(unsigned long addr, int is_write, int is_user, void *retaddr)

{

    TranslationBlock *tb;

    CPUState *saved_env;

    unsigned long pc;

    int ret;



    /* XXX: hack to restore env in all cases, even if not called from

       generated code */

    saved_env = env;

    env = cpu_single_env;

    {

        unsigned long tlb_addrr, tlb_addrw;

        int index;

        index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);

        tlb_addrr = env->tlb_read[is_user][index].address;

        tlb_addrw = env->tlb_write[is_user][index].address;

#if 0

        if (loglevel) {

            fprintf(logfile,

                    "%s 1 %p %p idx=%d addr=0x%08lx tbl_addr=0x%08lx 0x%08lx "

               "(0x%08lx 0x%08lx)\n", __func__, env,

               &env->tlb_read[is_user][index], index, addr,

               tlb_addrr, tlb_addrw, addr & TARGET_PAGE_MASK,

               tlb_addrr & (TARGET_PAGE_MASK | TLB_INVALID_MASK));

        }

#endif

    }

    ret = cpu_ppc_handle_mmu_fault(env, addr, is_write, is_user, 1);

    if (ret) {

        if (retaddr) {

            /* now we have a real cpu fault */

            pc = (unsigned long)retaddr;

            tb = tb_find_pc(pc);

            if (tb) {

                /* the PC is inside the translated code. It means that we have

                   a virtual CPU fault */

                cpu_restore_state(tb, env, pc, NULL);

            }

        }

        do_raise_exception_err(env->exception_index, env->error_code);

    }

    {

        unsigned long tlb_addrr, tlb_addrw;

        int index;

        index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);

        tlb_addrr = env->tlb_read[is_user][index].address;

        tlb_addrw = env->tlb_write[is_user][index].address;

#if 0

        printf("%s 2 %p %p idx=%d addr=0x%08lx tbl_addr=0x%08lx 0x%08lx "

               "(0x%08lx 0x%08lx)\n", __func__, env,

               &env->tlb_read[is_user][index], index, addr,

               tlb_addrr, tlb_addrw, addr & TARGET_PAGE_MASK,

               tlb_addrr & (TARGET_PAGE_MASK | TLB_INVALID_MASK));

#endif

    }

    env = saved_env;

}

void tlb_fill(unsigned long addr, int is_write, int is_user, void *retaddr)

{

    TranslationBlock *tb;

    CPUState *saved_env;

    unsigned long pc;

    int ret;



    



    saved_env = env;

    env = cpu_single_env;

    {

        unsigned long tlb_addrr, tlb_addrw;

        int index;

        index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);

        tlb_addrr = env->tlb_read[is_user][index].address;

        tlb_addrw = env->tlb_write[is_user][index].address;

#if 0

        if (loglevel) {

            fprintf(logfile,

                    "%s 1 %p %p idx=%d addr=0x%08lx tbl_addr=0x%08lx 0x%08lx "

               "(0x%08lx 0x%08lx)\n", __func__, env,

               &env->tlb_read[is_user][index], index, addr,

               tlb_addrr, tlb_addrw, addr & TARGET_PAGE_MASK,

               tlb_addrr & (TARGET_PAGE_MASK | TLB_INVALID_MASK));

        }

#endif

    }

    ret = cpu_ppc_handle_mmu_fault(env, addr, is_write, is_user, 1);

    if (ret) {

        if (retaddr) {

            

            pc = (unsigned long)retaddr;

            tb = tb_find_pc(pc);

            if (tb) {

                



                cpu_restore_state(tb, env, pc, NULL);

            }

        }

        do_raise_exception_err(env->exception_index, env->error_code);

    }

    {

        unsigned long tlb_addrr, tlb_addrw;

        int index;

        index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);

        tlb_addrr = env->tlb_read[is_user][index].address;

        tlb_addrw = env->tlb_write[is_user][index].address;

#if 0

        printf("%s 2 %p %p idx=%d addr=0x%08lx tbl_addr=0x%08lx 0x%08lx "

               "(0x%08lx 0x%08lx)\n", __func__, env,

               &env->tlb_read[is_user][index], index, addr,

               tlb_addrr, tlb_addrw, addr & TARGET_PAGE_MASK,

               tlb_addrr & (TARGET_PAGE_MASK | TLB_INVALID_MASK));

#endif

    }

    env = saved_env;

}

void FUNC_0(unsigned long VAR_0, int VAR_1, int VAR_2, void *VAR_3)

{

    TranslationBlock *tb;

    CPUState *saved_env;

    unsigned long VAR_4;

    int VAR_5;



    



    saved_env = env;

    env = cpu_single_env;

    {

        unsigned long VAR_9, VAR_9;

        int VAR_9;

        VAR_9 = (VAR_0 >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);

        VAR_9 = env->tlb_read[VAR_2][VAR_9].address;

        VAR_9 = env->tlb_write[VAR_2][VAR_9].address;

#if 0

        if (loglevel) {

            fprintf(logfile,

                    "%s 1 %p %p idx=%d VAR_0=0x%08lx tbl_addr=0x%08lx 0x%08lx "

               "(0x%08lx 0x%08lx)\n", __func__, env,

               &env->tlb_read[VAR_2][VAR_9], VAR_9, VAR_0,

               VAR_9, VAR_9, VAR_0 & TARGET_PAGE_MASK,

               VAR_9 & (TARGET_PAGE_MASK | TLB_INVALID_MASK));

        }

#endif

    }

    VAR_5 = cpu_ppc_handle_mmu_fault(env, VAR_0, VAR_1, VAR_2, 1);

    if (VAR_5) {

        if (VAR_3) {

            

            VAR_4 = (unsigned long)VAR_3;

            tb = tb_find_pc(VAR_4);

            if (tb) {

                



                cpu_restore_state(tb, env, VAR_4, NULL);

            }

        }

        do_raise_exception_err(env->exception_index, env->error_code);

    }

    {

        unsigned long VAR_9, VAR_9;

        int VAR_9;

        VAR_9 = (VAR_0 >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);

        VAR_9 = env->tlb_read[VAR_2][VAR_9].address;

        VAR_9 = env->tlb_write[VAR_2][VAR_9].address;

#if 0

        printf("%s 2 %p %p idx=%d VAR_0=0x%08lx tbl_addr=0x%08lx 0x%08lx "

               "(0x%08lx 0x%08lx)\n", __func__, env,

               &env->tlb_read[VAR_2][VAR_9], VAR_9, VAR_0,

               VAR_9, VAR_9, VAR_0 & TARGET_PAGE_MASK,

               VAR_9 & (TARGET_PAGE_MASK | TLB_INVALID_MASK));

#endif

    }

    env = saved_env;

}

void FUNC_0(unsigned long VAR_0, int VAR_1, int VAR_2, void *VAR_3)
{ TranslationBlock *tb; CPUState *saved_env; unsigned long VAR_4; int VAR_5; saved_env = env; env = cpu_single_env; { unsigned long VAR_9, VAR_9; int VAR_9; VAR_9 = (VAR_0 >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); VAR_9 = env->tlb_read[VAR_2][VAR_9].address; VAR_9 = env->tlb_write[VAR_2][VAR_9].address; #if 0
if (loglevel) { fprintf(logfile,
"%s 1 %p %p idx=%d VAR_0=0x%08lx tbl_addr=0x%08lx 0x%08lx "
"(0x%08lx 0x%08lx)\n", __func__, env,
&env->tlb_read[VAR_2][VAR_9], VAR_9, VAR_0,
VAR_9, VAR_9, VAR_0 & TARGET_PAGE_MASK,
VAR_9 & (TARGET_PAGE_MASK | TLB_INVALID_MASK)); } #endif
} VAR_5 = cpu_ppc_handle_mmu_fault(env, VAR_0, VAR_1, VAR_2, 1); if (VAR_5) { if (VAR_3) { VAR_4 = (unsigned long)VAR_3; tb = tb_find_pc(VAR_4); if (tb) { cpu_restore_state(tb, env, VAR_4, NULL); } } do_raise_exception_err(env->exception_index, env->error_code); } { unsigned long VAR_9, VAR_9; int VAR_9; VAR_9 = (VAR_0 >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); VAR_9 = env->tlb_read[VAR_2][VAR_9].address; VAR_9 = env->tlb_write[VAR_2][VAR_9].address; #if 0
printf("%s 2 %p %p idx=%d VAR_0=0x%08lx tbl_addr=0x%08lx 0x%08lx "
"(0x%08lx 0x%08lx)\n", __func__, env,
&env->tlb_read[VAR_2][VAR_9], VAR_9, VAR_0,
VAR_9, VAR_9, VAR_0 & TARGET_PAGE_MASK,
VAR_9 & (TARGET_PAGE_MASK | TLB_INVALID_MASK)); #endif
} env = saved_env; }