void ppc_store_sdr1(CPUPPCState *env, target_ulong value)

{

    LOG_MMU("%s: " TARGET_FMT_lx "\n", __func__, value);

    if (env->spr[SPR_SDR1] != value) {

        env->spr[SPR_SDR1] = value;

#if defined(TARGET_PPC64)

        if (env->mmu_model & POWERPC_MMU_64) {

            target_ulong htabsize = value & SDR_64_HTABSIZE;



            if (htabsize > 28) {

                fprintf(stderr, "Invalid HTABSIZE 0x" TARGET_FMT_lx

                        " stored in SDR1\n", htabsize);

                htabsize = 28;

            }

            env->htab_mask = (1ULL << (htabsize + 18)) - 1;

            env->htab_base = value & SDR_64_HTABORG;

        } else

#endif /* defined(TARGET_PPC64) */

        {

            /* FIXME: Should check for valid HTABMASK values */

            env->htab_mask = ((value & SDR_32_HTABMASK) << 16) | 0xFFFF;

            env->htab_base = value & SDR_32_HTABORG;

        }

        tlb_flush(env, 1);

    }

}

void ppc_store_sdr1(CPUPPCState *env, target_ulong value)

{

    LOG_MMU("%s: " TARGET_FMT_lx "\n", __func__, value);

    if (env->spr[SPR_SDR1] != value) {

        env->spr[SPR_SDR1] = value;

#if defined(TARGET_PPC64)

        if (env->mmu_model & POWERPC_MMU_64) {

            target_ulong htabsize = value & SDR_64_HTABSIZE;



            if (htabsize > 28) {

                fprintf(stderr, "Invalid HTABSIZE 0x" TARGET_FMT_lx

                        " stored in SDR1\n", htabsize);

                htabsize = 28;

            }

            env->htab_mask = (1ULL << (htabsize + 18)) - 1;

            env->htab_base = value & SDR_64_HTABORG;

        } else

#endif 

        {

            

            env->htab_mask = ((value & SDR_32_HTABMASK) << 16) | 0xFFFF;

            env->htab_base = value & SDR_32_HTABORG;

        }

        tlb_flush(env, 1);

    }

}

            env->htab_mask = (1ULL << (htabsize + 18)) - 1;
void FUNC_0(CPUPPCState *VAR_0, target_ulong VAR_1)

{

    LOG_MMU("%s: " TARGET_FMT_lx "\n", __func__, VAR_1);

    if (VAR_0->spr[SPR_SDR1] != VAR_1) {

        VAR_0->spr[SPR_SDR1] = VAR_1;

#if defined(TARGET_PPC64)

        if (VAR_0->mmu_model & POWERPC_MMU_64) {

            target_ulong htabsize = VAR_1 & SDR_64_HTABSIZE;



            if (htabsize > 28) {

                fprintf(stderr, "Invalid HTABSIZE 0x" TARGET_FMT_lx

                        " stored in SDR1\n", htabsize);

                htabsize = 28;

            }

            VAR_0->htab_mask = (1ULL << (htabsize + 18)) - 1;

            VAR_0->htab_base = VAR_1 & SDR_64_HTABORG;

        } else

#endif 

        {

            

            VAR_0->htab_mask = ((VAR_1 & SDR_32_HTABMASK) << 16) | 0xFFFF;

            VAR_0->htab_base = VAR_1 & SDR_32_HTABORG;

        }

        tlb_flush(VAR_0, 1);

    }

}

void FUNC_0(CPUPPCState *VAR_0, target_ulong VAR_1)
{ LOG_MMU("%s: " TARGET_FMT_lx "\n", __func__, VAR_1); if (VAR_0->spr[SPR_SDR1] != VAR_1) { VAR_0->spr[SPR_SDR1] = VAR_1; #if defined(TARGET_PPC64)
if (VAR_0->mmu_model & POWERPC_MMU_64) { target_ulong htabsize = VAR_1 & SDR_64_HTABSIZE; if (htabsize > 28) { fprintf(stderr, "Invalid HTABSIZE 0x" TARGET_FMT_lx
" stored in SDR1\n", htabsize); htabsize = 28; } VAR_0->htab_mask = (1ULL << (htabsize + 18)) - 1; VAR_0->htab_base = VAR_1 & SDR_64_HTABORG; } else #endif
{ VAR_0->htab_mask = ((VAR_1 & SDR_32_HTABMASK) << 16) | 0xFFFF; VAR_0->htab_base = VAR_1 & SDR_32_HTABORG; } tlb_flush(VAR_0, 1); } }