fixed compilation with cpu-level < 5

This commit is contained in:
Stanislav Shwartsman 2016-04-21 15:39:49 +00:00
parent 87cb831a37
commit ca5882b310
2 changed files with 10 additions and 0 deletions

View File

@ -899,10 +899,12 @@ BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::LMSW_Ew(bxInstruction_c *i)
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::SMSW_EwR(bxInstruction_c *i)
{
#if BX_CPU_LEVEL >= 5
if (CPL!=0 && BX_CPU_THIS_PTR cr4.get_UMIP()) {
BX_ERROR(("SMSW: CPL != 0 causes #GP when CR4.UMIP set"));
exception(BX_GP_EXCEPTION, 0);
}
#endif
Bit32u msw = (Bit32u) read_CR0(); // handle CR0 shadow in VMX

View File

@ -286,10 +286,12 @@ BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::SLDT_Ew(bxInstruction_c *i)
exception(BX_UD_EXCEPTION, 0);
}
#if BX_CPU_LEVEL >= 5
if (CPL!=0 && BX_CPU_THIS_PTR cr4.get_UMIP()) {
BX_ERROR(("SLDT: CPL != 0 causes #GP when CR4.UMIP set"));
exception(BX_GP_EXCEPTION, 0);
}
#endif
#if BX_SUPPORT_VMX >= 2
if (BX_CPU_THIS_PTR in_vmx_guest)
@ -328,10 +330,12 @@ BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::STR_Ew(bxInstruction_c *i)
exception(BX_UD_EXCEPTION, 0);
}
#if BX_CPU_LEVEL >= 5
if (CPL!=0 && BX_CPU_THIS_PTR cr4.get_UMIP()) {
BX_ERROR(("STR: CPL != 0 causes #GP when CR4.UMIP set"));
exception(BX_GP_EXCEPTION, 0);
}
#endif
#if BX_SUPPORT_VMX >= 2
if (BX_CPU_THIS_PTR in_vmx_guest)
@ -756,10 +760,12 @@ BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::SGDT_Ms(bxInstruction_c *i)
{
BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64);
#if BX_CPU_LEVEL >= 5
if (CPL!=0 && BX_CPU_THIS_PTR cr4.get_UMIP()) {
BX_ERROR(("SGDT: CPL != 0 causes #GP when CR4.UMIP set"));
exception(BX_GP_EXCEPTION, 0);
}
#endif
#if BX_SUPPORT_VMX >= 2
if (BX_CPU_THIS_PTR in_vmx_guest)
@ -786,10 +792,12 @@ BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::SGDT_Ms(bxInstruction_c *i)
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::SIDT_Ms(bxInstruction_c *i)
{
#if BX_CPU_LEVEL >= 5
if (CPL!=0 && BX_CPU_THIS_PTR cr4.get_UMIP()) {
BX_ERROR(("SIDT: CPL != 0 causes #GP when CR4.UMIP set"));
exception(BX_GP_EXCEPTION, 0);
}
#endif
BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64);