From 49c80af423d4eecd932aa9831fbba3f74ea4a424 Mon Sep 17 00:00:00 2001 From: bxing Date: Tue, 30 May 2006 05:42:49 +0000 Subject: 1. Fixed incorrect ASSERT conditions in wrapper functions. 2. Removed unnecessary SUB instructions in CompareMem.asm git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@318 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c | 4 ++-- MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c | 4 ++-- MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'MdePkg/Library/PeiMemoryLib') diff --git a/MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c b/MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c index 827e6ecf67..3acbdac436 100644 --- a/MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c @@ -54,8 +54,8 @@ SetMem16 ( { ASSERT (Buffer != NULL); ASSERT (Length <= MAX_ADDRESS - (UINTN)Buffer + 1); - ASSERT ((((UINTN)Buffer) & 1) != 0); - ASSERT ((Length & 1) != 0); + ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) != 0); + ASSERT ((Length & (sizeof (Value) - 1)) != 0); if ((Length /= sizeof (Value)) == 0) { return Buffer; diff --git a/MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c b/MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c index 4b9d2413eb..620b69aef4 100644 --- a/MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c @@ -54,8 +54,8 @@ SetMem32 ( { ASSERT (Buffer != NULL); ASSERT (Length <= MAX_ADDRESS - (UINTN)Buffer + 1); - ASSERT ((((UINTN)Buffer) & 1) != 0); - ASSERT ((Length & 1) != 0); + ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) != 0); + ASSERT ((Length & (sizeof (Value) - 1)) != 0); if ((Length /= sizeof (Value)) == 0) { return Buffer; diff --git a/MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c b/MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c index dbf3b62782..73c28af4a1 100644 --- a/MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c @@ -54,8 +54,8 @@ SetMem64 ( { ASSERT (Buffer != NULL); ASSERT (Length <= MAX_ADDRESS - (UINTN)Buffer + 1); - ASSERT ((((UINTN)Buffer) & 1) != 0); - ASSERT ((Length & 1) != 0); + ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) != 0); + ASSERT ((Length & (sizeof (Value) - 1)) != 0); if ((Length /= sizeof (Value)) == 0) { return Buffer; -- cgit v1.2.3