diff --git a/reactos/lib/fast486/common.inl b/reactos/lib/fast486/common.inl index 084bf1e2288..381ed032cdc 100644 --- a/reactos/lib/fast486/common.inl +++ b/reactos/lib/fast486/common.inl @@ -112,13 +112,12 @@ Fast486GetPageTableEntry(PFAST486_STATE State, /* Make sure it is present */ if (!TableEntry.Present) return 0; - if (MarkAsDirty) TableEntry.Dirty = TRUE; - - /* Was the table entry accessed before? */ - if (!TableEntry.Accessed) + /* Do we need to change any flags? */ + if (!TableEntry.Accessed || (MarkAsDirty && !TableEntry.Dirty)) { - /* Well, it is now */ + /* Mark it as accessed and optionally dirty too */ TableEntry.Accessed = TRUE; + if (MarkAsDirty) TableEntry.Dirty = TRUE; /* Write back the table entry */ State->MemWriteCallback(State, @@ -512,6 +511,7 @@ Fast486LoadSegmentInternal(PFAST486_STATE State, { /* Invalid selector */ Fast486ExceptionWithErrorCode(State, Exception, Selector); + return FALSE; } if (Segment == FAST486_REG_SS) @@ -569,6 +569,7 @@ Fast486LoadSegmentInternal(PFAST486_STATE State, { /* Must be a segment descriptor */ Fast486ExceptionWithErrorCode(State, Exception, Selector); + return FALSE; } if (!GdtEntry.Present) diff --git a/reactos/lib/fast486/fpu.h b/reactos/lib/fast486/fpu.h index b23c795d32b..056ef8335d2 100644 --- a/reactos/lib/fast486/fpu.h +++ b/reactos/lib/fast486/fpu.h @@ -28,7 +28,7 @@ /* DEFINES ********************************************************************/ -#define FPU_CHECK() if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_EM) \ +#define FPU_CHECK() if (State->ControlRegisters[FAST486_REG_CR0] & (FAST486_CR0_EM | FAST486_CR0_TS)) \ { \ Fast486Exception(State, FAST486_EXCEPTION_NM); \ return; \