{
ULONG LinearAddress;
PFAST486_SEG_REG CachedDescriptor;
+ FAST486_EXCEPTIONS Exception = SegmentReg != FAST486_REG_SS
+ ? FAST486_EXCEPTION_GP : FAST486_EXCEPTION_SS;
ASSERT(SegmentReg < FAST486_NUM_SEG_REGS);
if ((Offset + Size - 1) > CachedDescriptor->Limit)
{
/* Read beyond limit */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ Fast486Exception(State, Exception);
return FALSE;
}
}
if (Offset < CachedDescriptor->Limit)
{
/* Read beyond limit */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ Fast486Exception(State, Exception);
return FALSE;
}
}
if (!CachedDescriptor->Present)
{
- Fast486Exception(State, FAST486_EXCEPTION_NP);
+ Fast486Exception(State, Exception);
return FALSE;
}
if ((!InstFetch && (CachedDescriptor->Rpl > CachedDescriptor->Dpl))
|| (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl))
{
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ Fast486Exception(State, Exception);
return FALSE;
}
if (!CachedDescriptor->Executable)
{
/* Data segment not executable */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ Fast486Exception(State, Exception);
return FALSE;
}
}
if (CachedDescriptor->Executable && (!CachedDescriptor->ReadWrite))
{
/* Code segment not readable */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ Fast486Exception(State, Exception);
return FALSE;
}
}
{
ULONG LinearAddress;
PFAST486_SEG_REG CachedDescriptor;
+ FAST486_EXCEPTIONS Exception = SegmentReg != FAST486_REG_SS
+ ? FAST486_EXCEPTION_GP : FAST486_EXCEPTION_SS;
ASSERT(SegmentReg < FAST486_NUM_SEG_REGS);
if ((Offset + Size - 1) > CachedDescriptor->Limit)
{
/* Write beyond limit */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ Fast486Exception(State, Exception);
return FALSE;
}
}
{
if (Offset < CachedDescriptor->Limit)
{
- /* Read beyond limit */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ /* Write beyond limit */
+ Fast486Exception(State, Exception);
return FALSE;
}
}
if (!CachedDescriptor->Present)
{
- Fast486Exception(State, FAST486_EXCEPTION_NP);
+ Fast486Exception(State, Exception);
return FALSE;
}
if ((CachedDescriptor->Rpl > CachedDescriptor->Dpl)
|| (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl))
{
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ Fast486Exception(State, Exception);
return FALSE;
}
if (CachedDescriptor->Executable)
{
/* Code segment not writable */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ Fast486Exception(State, Exception);
return FALSE;
}
else if (!CachedDescriptor->ReadWrite)
{
/* Data segment not writeable */
- Fast486Exception(State, FAST486_EXCEPTION_GP);
+ Fast486Exception(State, Exception);
return FALSE;
}
}