mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:53:40 +00:00
[FAST486]
Properly check the limit for "expand down" segments. svn path=/trunk/; revision=67528
This commit is contained in:
parent
3da5321a16
commit
923efbbc4e
1 changed files with 32 additions and 8 deletions
|
@ -47,12 +47,24 @@ Fast486ReadMemory(PFAST486_STATE State,
|
||||||
/* Get the cached descriptor */
|
/* Get the cached descriptor */
|
||||||
CachedDescriptor = &State->SegmentRegs[SegmentReg];
|
CachedDescriptor = &State->SegmentRegs[SegmentReg];
|
||||||
|
|
||||||
|
if (InstFetch || !CachedDescriptor->DirConf)
|
||||||
|
{
|
||||||
if ((Offset + Size - 1) > CachedDescriptor->Limit)
|
if ((Offset + Size - 1) > CachedDescriptor->Limit)
|
||||||
{
|
{
|
||||||
/* Read beyond limit */
|
/* Read beyond limit */
|
||||||
Fast486Exception(State, FAST486_EXCEPTION_GP);
|
Fast486Exception(State, FAST486_EXCEPTION_GP);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Offset < CachedDescriptor->Limit)
|
||||||
|
{
|
||||||
|
/* Read beyond limit */
|
||||||
|
Fast486Exception(State, FAST486_EXCEPTION_GP);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Check for protected mode */
|
/* Check for protected mode */
|
||||||
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
|
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
|
||||||
|
@ -157,12 +169,24 @@ Fast486WriteMemory(PFAST486_STATE State,
|
||||||
/* Get the cached descriptor */
|
/* Get the cached descriptor */
|
||||||
CachedDescriptor = &State->SegmentRegs[SegmentReg];
|
CachedDescriptor = &State->SegmentRegs[SegmentReg];
|
||||||
|
|
||||||
|
if (!CachedDescriptor->DirConf)
|
||||||
|
{
|
||||||
if ((Offset + Size - 1) > CachedDescriptor->Limit)
|
if ((Offset + Size - 1) > CachedDescriptor->Limit)
|
||||||
{
|
{
|
||||||
/* Write beyond limit */
|
/* Write beyond limit */
|
||||||
Fast486Exception(State, FAST486_EXCEPTION_GP);
|
Fast486Exception(State, FAST486_EXCEPTION_GP);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Offset < CachedDescriptor->Limit)
|
||||||
|
{
|
||||||
|
/* Read beyond limit */
|
||||||
|
Fast486Exception(State, FAST486_EXCEPTION_GP);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Check for protected mode */
|
/* Check for protected mode */
|
||||||
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
|
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue