int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,

                               int mmu_idx, int is_softmmu)

{

#if !defined(CONFIG_USER_ONLY)

    target_phys_addr_t physical;

    int prot;

#endif

    int access_type;

    int ret = 0;



#if 0

    log_cpu_state(env, 0);

#endif

    qemu_log("%s pc " TARGET_FMT_lx " ad " TARGET_FMT_lx " rw %d mmu_idx %d smmu %d\n",

              __func__, env->active_tc.PC, address, rw, mmu_idx, is_softmmu);



    rw &= 1;



    /* data access */

    /* XXX: put correct access by using cpu_restore_state()

       correctly */

    access_type = ACCESS_INT;

#if defined(CONFIG_USER_ONLY)

    ret = TLBRET_NOMATCH;

#else

    ret = get_physical_address(env, &physical, &prot,

                               address, rw, access_type);

    qemu_log("%s address=" TARGET_FMT_lx " ret %d physical " TARGET_FMT_plx " prot %d\n",

              __func__, address, ret, physical, prot);

    if (ret == TLBRET_MATCH) {

       ret = tlb_set_page(env, address & TARGET_PAGE_MASK,

                          physical & TARGET_PAGE_MASK, prot,

                          mmu_idx, is_softmmu);

    } else if (ret < 0)

#endif

    {

        raise_mmu_exception(env, address, rw, ret);

        ret = 1;

    }



    return ret;

}

int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,

                               int mmu_idx, int is_softmmu)

{

#if !defined(CONFIG_USER_ONLY)

    target_phys_addr_t physical;

    int prot;

#endif

    int access_type;

    int ret = 0;



#if 0

    log_cpu_state(env, 0);

#endif

    qemu_log("%s pc " TARGET_FMT_lx " ad " TARGET_FMT_lx " rw %d mmu_idx %d smmu %d\n",

              __func__, env->active_tc.PC, address, rw, mmu_idx, is_softmmu);



    rw &= 1;



    

    



    access_type = ACCESS_INT;

#if defined(CONFIG_USER_ONLY)

    ret = TLBRET_NOMATCH;

#else

    ret = get_physical_address(env, &physical, &prot,

                               address, rw, access_type);

    qemu_log("%s address=" TARGET_FMT_lx " ret %d physical " TARGET_FMT_plx " prot %d\n",

              __func__, address, ret, physical, prot);

    if (ret == TLBRET_MATCH) {

       ret = tlb_set_page(env, address & TARGET_PAGE_MASK,

                          physical & TARGET_PAGE_MASK, prot,

                          mmu_idx, is_softmmu);

    } else if (ret < 0)

#endif

    {

        raise_mmu_exception(env, address, rw, ret);

        ret = 1;

    }



    return ret;

}

int FUNC_0 (CPUState *VAR_0, target_ulong VAR_1, int VAR_2,

                               int VAR_3, int VAR_4)

{

#if !defined(CONFIG_USER_ONLY)

    target_phys_addr_t physical;

    int VAR_5;

#endif

    int VAR_6;

    int VAR_7 = 0;



#if 0

    log_cpu_state(VAR_0, 0);

#endif

    qemu_log("%s pc " TARGET_FMT_lx " ad " TARGET_FMT_lx " VAR_2 %d VAR_3 %d smmu %d\n",

              __func__, VAR_0->active_tc.PC, VAR_1, VAR_2, VAR_3, VAR_4);



    VAR_2 &= 1;



    

    



    VAR_6 = ACCESS_INT;

#if defined(CONFIG_USER_ONLY)

    VAR_7 = TLBRET_NOMATCH;

#else

    VAR_7 = get_physical_address(VAR_0, &physical, &VAR_5,

                               VAR_1, VAR_2, VAR_6);

    qemu_log("%s VAR_1=" TARGET_FMT_lx " VAR_7 %d physical " TARGET_FMT_plx " VAR_5 %d\n",

              __func__, VAR_1, VAR_7, physical, VAR_5);

    if (VAR_7 == TLBRET_MATCH) {

       VAR_7 = tlb_set_page(VAR_0, VAR_1 & TARGET_PAGE_MASK,

                          physical & TARGET_PAGE_MASK, VAR_5,

                          VAR_3, VAR_4);

    } else if (VAR_7 < 0)

#endif

    {

        raise_mmu_exception(VAR_0, VAR_1, VAR_2, VAR_7);

        VAR_7 = 1;

    }



    return VAR_7;

}

int FUNC_0 (CPUState *VAR_0, target_ulong VAR_1, int VAR_2,
int VAR_3, int VAR_4)
{ #if !defined(CONFIG_USER_ONLY)
target_phys_addr_t physical; int VAR_5; #endif
int VAR_6; int VAR_7 = 0; #if 0
log_cpu_state(VAR_0, 0); #endif
qemu_log("%s pc " TARGET_FMT_lx " ad " TARGET_FMT_lx " VAR_2 %d VAR_3 %d smmu %d\n",
__func__, VAR_0->active_tc.PC, VAR_1, VAR_2, VAR_3, VAR_4); VAR_2 &= 1; VAR_6 = ACCESS_INT; #if defined(CONFIG_USER_ONLY)
VAR_7 = TLBRET_NOMATCH; #else
VAR_7 = get_physical_address(VAR_0, &physical, &VAR_5,
VAR_1, VAR_2, VAR_6); qemu_log("%s VAR_1=" TARGET_FMT_lx " VAR_7 %d physical " TARGET_FMT_plx " VAR_5 %d\n",
__func__, VAR_1, VAR_7, physical, VAR_5); if (VAR_7 == TLBRET_MATCH) { VAR_7 = tlb_set_page(VAR_0, VAR_1 & TARGET_PAGE_MASK,
physical & TARGET_PAGE_MASK, VAR_5,
VAR_3, VAR_4); } else if (VAR_7 < 0) #endif
{ raise_mmu_exception(VAR_0, VAR_1, VAR_2, VAR_7); VAR_7 = 1; } return VAR_7; }