Author: aandrejevic
Date: Sat Sep 26 19:22:50 2015
New Revision: 69367
URL:
http://svn.reactos.org/svn/reactos?rev=69367&view=rev
Log:
[FAST486]
Whether a TSS is 16-bit or 32-bit depends solely on its signature.
Its size is irrelevant.
Modified:
trunk/reactos/lib/fast486/common.c
trunk/reactos/lib/fast486/opgroups.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 Sep 26 19:22:50 2015
@@ -328,7 +328,7 @@
if (!Fast486ReadLinearMemory(State,
State->TaskReg.Base,
&Tss,
- State->TaskReg.Limit >=
(sizeof(FAST486_TSS) - 1)
+ State->TaskReg.Modern
? sizeof(FAST486_TSS) :
sizeof(FAST486_LEGACY_TSS),
FALSE))
{
@@ -347,7 +347,7 @@
{
case 0:
{
- if (State->TaskReg.Limit >= (sizeof(FAST486_TSS) - 1))
+ if (State->TaskReg.Modern)
{
NewSs = Tss.Ss0;
NewEsp = Tss.Esp0;
@@ -363,7 +363,7 @@
case 1:
{
- if (State->TaskReg.Limit >= (sizeof(FAST486_TSS) - 1))
+ if (State->TaskReg.Modern)
{
NewSs = Tss.Ss1;
NewEsp = Tss.Esp1;
@@ -379,7 +379,7 @@
case 2:
{
- if (State->TaskReg.Limit >= (sizeof(FAST486_TSS) - 1))
+ if (State->TaskReg.Modern)
{
NewSs = Tss.Ss2;
NewEsp = Tss.Esp2;
@@ -632,7 +632,7 @@
if (!Fast486ReadLinearMemory(State,
State->TaskReg.Base,
&OldTss,
- State->TaskReg.Limit >= (sizeof(FAST486_TSS) - 1)
+ State->TaskReg.Modern
? sizeof(FAST486_TSS) : sizeof(FAST486_LEGACY_TSS),
FALSE))
{
@@ -644,7 +644,7 @@
/* If this is a task return, use the linked previous selector */
if (Type == FAST486_TASK_RETURN)
{
- if (State->TaskReg.Limit >= (sizeof(FAST486_TSS) - 1)) Selector =
LOWORD(OldTss.Link);
+ if (State->TaskReg.Modern) Selector = LOWORD(OldTss.Link);
else Selector = OldLegacyTss->Link;
}
@@ -761,7 +761,7 @@
}
/* Save the current task into the TSS */
- if (State->TaskReg.Limit >= (sizeof(FAST486_TSS) - 1))
+ if (State->TaskReg.Modern)
{
OldTss.Cr3 = State->ControlRegisters[FAST486_REG_CR3];
OldTss.Eip = State->InstPtr.Long;
@@ -805,7 +805,7 @@
if (!Fast486WriteLinearMemory(State,
State->TaskReg.Base,
&OldTss,
- State->TaskReg.Limit >= (sizeof(FAST486_TSS) -
1)
+ State->TaskReg.Modern
? sizeof(FAST486_TSS) : sizeof(FAST486_LEGACY_TSS),
FALSE))
{
@@ -1059,7 +1059,7 @@
if (!Fast486ReadLinearMemory(State,
State->TaskReg.Base,
&Tss,
- State->TaskReg.Limit >=
(sizeof(FAST486_TSS) - 1)
+ State->TaskReg.Modern
? sizeof(FAST486_TSS) :
sizeof(FAST486_LEGACY_TSS),
FALSE))
{
@@ -1075,7 +1075,7 @@
{
case 0:
{
- if (State->TaskReg.Limit >= (sizeof(FAST486_TSS) - 1))
+ if (State->TaskReg.Modern)
{
NewSs = Tss.Ss0;
NewEsp = Tss.Esp0;
@@ -1091,7 +1091,7 @@
case 1:
{
- if (State->TaskReg.Limit >= (sizeof(FAST486_TSS) - 1))
+ if (State->TaskReg.Modern)
{
NewSs = Tss.Ss1;
NewEsp = Tss.Esp1;
@@ -1107,7 +1107,7 @@
case 2:
{
- if (State->TaskReg.Limit >= (sizeof(FAST486_TSS) - 1))
+ if (State->TaskReg.Modern)
{
NewSs = Tss.Ss2;
NewEsp = Tss.Esp2;
Modified: trunk/reactos/lib/fast486/opgroups.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opgroups.c?rev…
==============================================================================
--- trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] Sat Sep 26 19:22:50 2015
@@ -1960,6 +1960,8 @@
State->TaskReg.Selector = Selector;
State->TaskReg.Base = GdtEntry.Base | (GdtEntry.BaseMid << 16) |
(GdtEntry.BaseHigh << 24);
State->TaskReg.Limit = GdtEntry.Limit | (GdtEntry.LimitHigh << 16);
+ State->TaskReg.Modern = GdtEntry.Signature == FAST486_TSS_SIGNATURE
+ || GdtEntry.Signature == FAST486_BUSY_TSS_SIGNATURE;
if (GdtEntry.Granularity)
{