summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-10 07:54:41 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-10 07:54:41 +0000
commit351d6e7fcc5391c0787fa645b1c7fb06c1e11c68 (patch)
treee3381c95df774ba9b5c482095b360e01db36185b /MdePkg
parent07d97279a370e6e66dc1ae9b848fbd5f4eca202e (diff)
downloadedk2-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
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c10
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