Correct ASSERT to more cases.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7847 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2009-03-10 07:54:41 +00:00
parent 07d97279a3
commit 351d6e7fcc
1 changed files with 7 additions and 3 deletions

View File

@ -68,7 +68,11 @@ InvalidateInstructionCacheRange (
IN UINTN Length
)
{
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
if (Length == 0) {
return Address;
}
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Address));
return Address;
}
@ -127,12 +131,12 @@ WriteBackInvalidateDataCacheRange (
UINTN Start;
UINTN End;
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
if (Length == 0) {
return Address;
}
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Address));
Start = (UINTN)Address;
//
// Calculate the cache line alignment