void cpu_x86_update_cr0(CPUX86State *env)

{

    int pg_state, pe_state;



#if defined(DEBUG_MMU)

    printf("CR0 update: CR0=0x%08x\n", env->cr[0]);

#endif

    pg_state = env->cr[0] & CR0_PG_MASK;

    if (pg_state != last_pg_state) {

        tlb_flush(env);

        last_pg_state = pg_state;

    }

    /* update PE flag in hidden flags */

    pe_state = (env->cr[0] & CR0_PE_MASK);

    env->hflags = (env->hflags & ~HF_PE_MASK) | (pe_state << HF_PE_SHIFT);

    /* ensure that ADDSEG is always set in real mode */

    env->hflags |= ((pe_state ^ 1) << HF_ADDSEG_SHIFT);

}

void cpu_x86_update_cr0(CPUX86State *env)

{

    int pg_state, pe_state;



#if defined(DEBUG_MMU)

    printf("CR0 update: CR0=0x%08x\n", env->cr[0]);

#endif

    pg_state = env->cr[0] & CR0_PG_MASK;

    if (pg_state != last_pg_state) {

        tlb_flush(env);

        last_pg_state = pg_state;

    }

    

    pe_state = (env->cr[0] & CR0_PE_MASK);

    env->hflags = (env->hflags & ~HF_PE_MASK) | (pe_state << HF_PE_SHIFT);

    

    env->hflags |= ((pe_state ^ 1) << HF_ADDSEG_SHIFT);

}

void FUNC_0(CPUX86State *VAR_0)

{

    int VAR_1, VAR_2;



#if defined(DEBUG_MMU)

    printf("CR0 update: CR0=0x%08x\n", VAR_0->cr[0]);

#endif

    VAR_1 = VAR_0->cr[0] & CR0_PG_MASK;

    if (VAR_1 != last_pg_state) {

        tlb_flush(VAR_0);

        last_pg_state = VAR_1;

    }

    

    VAR_2 = (VAR_0->cr[0] & CR0_PE_MASK);

    VAR_0->hflags = (VAR_0->hflags & ~HF_PE_MASK) | (VAR_2 << HF_PE_SHIFT);

    

    VAR_0->hflags |= ((VAR_2 ^ 1) << HF_ADDSEG_SHIFT);

}

void FUNC_0(CPUX86State *VAR_0)
{ int VAR_1, VAR_2; #if defined(DEBUG_MMU)
printf("CR0 update: CR0=0x%08x\n", VAR_0->cr[0]); #endif
VAR_1 = VAR_0->cr[0] & CR0_PG_MASK; if (VAR_1 != last_pg_state) { tlb_flush(VAR_0); last_pg_state = VAR_1; } VAR_2 = (VAR_0->cr[0] & CR0_PE_MASK); VAR_0->hflags = (VAR_0->hflags & ~HF_PE_MASK) | (VAR_2 << HF_PE_SHIFT); VAR_0->hflags |= ((VAR_2 ^ 1) << HF_ADDSEG_SHIFT); }