diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-10 07:54:41 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-10 07:54:41 +0000 |
commit | 351d6e7fcc5391c0787fa645b1c7fb06c1e11c68 (patch) | |
tree | e3381c95df774ba9b5c482095b360e01db36185b | |
parent | 07d97279a370e6e66dc1ae9b848fbd5f4eca202e (diff) | |
download | edk2-platforms-351d6e7fcc5391c0787fa645b1c7fb06c1e11c68.tar.xz |
Correct ASSERT to more cases.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7847 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c b/MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c index c2f62855fd..4fc695ee61 100644 --- a/MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c +++ b/MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c @@ -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
|