Author: aandrejevic
Date: Sat Nov 8 05:56:49 2014
New Revision: 65313
URL: http://svn.reactos.org/svn/reactos?rev=65313&view=rev
Log:
[FAST486]
Clear the prefix flags when an exception occurs.
Add another missing return after a call to Fast486Exception.
Modified:
trunk/reactos/lib/fast486/common.c
Modified: trunk/reactos/lib/fast486/common.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.c?rev=6…
==============================================================================
--- trunk/reactos/lib/fast486/common.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/common.c [iso-8859-1] Sat Nov 8 05:56:49 2014
@@ -290,11 +290,8 @@
if (GateSize != (State->SegmentRegs[FAST486_REG_CS].Size))
{
- /*
- * The gate size doesn't match the current operand size, so toggle
- * the OPSIZE flag.
- */
- State->PrefixFlags ^= FAST486_PREFIX_OPSIZE;
+ /* The gate size doesn't match the current operand size, so set the OPSIZE flag. */
+ State->PrefixFlags |= FAST486_PREFIX_OPSIZE;
}
/* Check if the interrupt handler is more privileged */
@@ -469,6 +466,9 @@
return;
}
+ /* Clear the prefix flags */
+ State->PrefixFlags = 0;
+
/* Restore the IP to the saved IP */
State->InstPtr = State->SavedInstPtr;
@@ -566,7 +566,8 @@
if (NewTssLimit < sizeof(FAST486_TSS))
{
/* TSS limit too small */
- Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_TS, Selector);
+ Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_TS, Selector);
+ return FALSE;
}
/*
Author: aandrejevic
Date: Sat Nov 8 02:56:54 2014
New Revision: 65312
URL: http://svn.reactos.org/svn/reactos?rev=65312&view=rev
Log:
[FAST486]
- Fix the FPU_CHECK() macro.
- Make sure pages are marked dirty even if they have been accessed before.
- Always return after calling Fast486Exception.
Modified:
trunk/reactos/lib/fast486/common.inl
trunk/reactos/lib/fast486/fpu.h
Modified: trunk/reactos/lib/fast486/common.inl
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.inl?rev…
==============================================================================
--- trunk/reactos/lib/fast486/common.inl [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/common.inl [iso-8859-1] Sat Nov 8 02:56:54 2014
@@ -112,13 +112,12 @@
/* Make sure it is present */
if (!TableEntry.Present) return 0;
- if (MarkAsDirty) TableEntry.Dirty = TRUE;
-
- /* Was the table entry accessed before? */
- if (!TableEntry.Accessed)
- {
- /* Well, it is now */
+ /* Do we need to change any flags? */
+ if (!TableEntry.Accessed || (MarkAsDirty && !TableEntry.Dirty))
+ {
+ /* 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 @@
{
/* Invalid selector */
Fast486ExceptionWithErrorCode(State, Exception, Selector);
+ return FALSE;
}
if (Segment == FAST486_REG_SS)
@@ -569,6 +569,7 @@
{
/* Must be a segment descriptor */
Fast486ExceptionWithErrorCode(State, Exception, Selector);
+ return FALSE;
}
if (!GdtEntry.Present)
Modified: trunk/reactos/lib/fast486/fpu.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fpu.h?rev=6531…
==============================================================================
--- trunk/reactos/lib/fast486/fpu.h [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/fpu.h [iso-8859-1] Sat Nov 8 02:56:54 2014
@@ -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; \
Author: aandrejevic
Date: Fri Nov 7 19:20:38 2014
New Revision: 65310
URL: http://svn.reactos.org/svn/reactos?rev=65310&view=rev
Log:
[FAST486]
Fix BT, BTC, BTS and BTR.
Modified:
trunk/reactos/lib/fast486/extraops.c
Modified: trunk/reactos/lib/fast486/extraops.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/extraops.c?rev…
==============================================================================
--- trunk/reactos/lib/fast486/extraops.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/extraops.c [iso-8859-1] Fri Nov 7 19:20:38 2014
@@ -752,7 +752,7 @@
* For memory operands, add the bit offset divided by
* the data size to the address
*/
- ModRegRm.MemoryAddress += BitNumber / DataSize;
+ ModRegRm.MemoryAddress += (BitNumber / DataSize) * (DataSize / 8);
}
/* Normalize the bit number */
@@ -936,7 +936,7 @@
* For memory operands, add the bit offset divided by
* the data size to the address
*/
- ModRegRm.MemoryAddress += BitNumber / DataSize;
+ ModRegRm.MemoryAddress += (BitNumber / DataSize) * (DataSize / 8);
}
/* Normalize the bit number */
@@ -1378,7 +1378,7 @@
* For memory operands, add the bit offset divided by
* the data size to the address
*/
- ModRegRm.MemoryAddress += BitNumber / DataSize;
+ ModRegRm.MemoryAddress += (BitNumber / DataSize) * (DataSize / 8);
}
/* Normalize the bit number */
@@ -1592,7 +1592,7 @@
* For memory operands, add the bit offset divided by
* the data size to the address
*/
- ModRegRm.MemoryAddress += BitNumber / DataSize;
+ ModRegRm.MemoryAddress += (BitNumber / DataSize) * (DataSize / 8);
}
/* Normalize the bit number */