[FAST486]

Fix the calculation of PageLength for the last page.


svn path=/branches/ntvdm/; revision=61275
This commit is contained in:
Aleksandar Andrejevic 2013-12-15 05:02:59 +00:00
parent 4c80791d47
commit ec32b3ef34

View file

@ -160,7 +160,7 @@ Fast486ReadLinearMemory(PFAST486_STATE State,
if (Page == PAGE_ALIGN(LinearAddress + Size - 1)) if (Page == PAGE_ALIGN(LinearAddress + Size - 1))
{ {
/* Read only a part of the page */ /* Read only a part of the page */
PageLength = PAGE_OFFSET(LinearAddress) + Size - PageOffset; PageLength = PAGE_OFFSET(LinearAddress + Size - 1) - PageOffset + 1;
} }
/* Read the memory */ /* Read the memory */
@ -228,7 +228,7 @@ Fast486WriteLinearMemory(PFAST486_STATE State,
if (Page == PAGE_ALIGN(LinearAddress + Size - 1)) if (Page == PAGE_ALIGN(LinearAddress + Size - 1))
{ {
/* Write only a part of the page */ /* Write only a part of the page */
PageLength = PAGE_OFFSET(LinearAddress) + Size - PageOffset; PageLength = PAGE_OFFSET(LinearAddress + Size - 1) - PageOffset + 1;
} }
/* Write the memory */ /* Write the memory */