return FALSE;
}
- if (GET_SEGMENT_RPL(CachedDescriptor->Selector) > CachedDescriptor->Dpl)
+ if ((!InstFetch && (GET_SEGMENT_RPL(CachedDescriptor->Selector) > CachedDescriptor->Dpl))
+ || (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl))
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
return FALSE;
{
/* Write beyond limit */
Fast486Exception(State, FAST486_EXCEPTION_GP);
-
return FALSE;
}
return FALSE;
}
- if (GET_SEGMENT_RPL(CachedDescriptor->Selector) > CachedDescriptor->Dpl)
+ if ((GET_SEGMENT_RPL(CachedDescriptor->Selector) > CachedDescriptor->Dpl)
+ || (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl))
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
return FALSE;
{
/* Read the TSS */
if (!Fast486ReadLinearMemory(State,
- State->Tss.Address,
+ State->TaskReg.Base,
&Tss,
sizeof(Tss)))
{
if (!Fast486StackPush(State, OldEsp)) return FALSE;
}
}
+ else
+ {
+ if (State->SegmentRegs[FAST486_REG_CS].Size)
+ {
+ /* Set OPSIZE, because INT always pushes 16-bit values in real mode */
+ State->PrefixFlags |= FAST486_PREFIX_OPSIZE;
+ }
+ }
/* Push EFLAGS */
if (!Fast486StackPush(State, State->Flags.Long)) return FALSE;
&& (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE))
{
/* Push the error code */
- Fast486StackPush(State, ErrorCode);
+ if (!Fast486StackPush(State, ErrorCode))
+ {
+ /*
+ * If this function failed, that means Fast486Exception
+ * was called again, so just return in this case.
+ */
+ return;
+ }
}
+
+ /* Reset the exception count */
+ State->ExceptionCount = 0;
}
/* EOF */