From 3117e70e364992002d6a3a7757bbb29f4a4e00be Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Sat, 8 Nov 2014 02:56:54 +0000 Subject: [PATCH] [FAST486] - Fix the FPU_CHECK() macro. - Make sure pages are marked dirty even if they have been accessed before. - Always return after calling Fast486Exception. svn path=/trunk/; revision=65312 --- reactos/lib/fast486/common.inl | 11 ++++++----- reactos/lib/fast486/fpu.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) 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; \