Reset correctly the register CR0 in protected mode by calling cpu_x86_update_cr0 instead of setting it manually.

This commit is contained in:
Spl3en 2015-12-25 04:55:15 +01:00
parent 9ca993d8aa
commit bb375e4fa9

View file

@ -132,12 +132,12 @@ void x86_reg_reset(struct uc_struct *uc)
break;
case UC_MODE_32:
env->hflags |= HF_CS32_MASK | HF_SS32_MASK | HF_OSFXSR_MASK;
env->cr[0] = CR0_PE_MASK; // protected mode
cpu_x86_update_cr0(env, CR0_PE_MASK); // protected mode
break;
case UC_MODE_64:
env->hflags |= HF_CS32_MASK | HF_SS32_MASK | HF_CS64_MASK | HF_LMA_MASK | HF_OSFXSR_MASK;
env->hflags &= ~(HF_ADDSEG_MASK);
env->cr[0] = CR0_PE_MASK; // protected mode
cpu_x86_update_cr0(env, CR0_PE_MASK); // protected mode
break;
}
}