From 56385d49874f4b7cee6c9a0652c6b7c10aff0e2f Mon Sep 17 00:00:00 2001 From: eric_tian Date: Mon, 7 Dec 2009 04:48:53 +0000 Subject: [PATCH] 1. fix the wrong description, change "target the buffer" to "the target buffer" 2. fix ICC/GYGGCC build failure on ScanMemN() in X64 arch, it can not reach the last sentence when UINTN is equal to UINT64. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9530 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BaseMemoryLib/MemLibGuid.c | 2 +- MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c | 7 ++++--- MdePkg/Library/BaseMemoryLib/SetMemWrapper.c | 3 ++- MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c | 2 +- MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c | 7 ++++--- MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c | 3 ++- MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c | 2 +- MdePkg/Library/BaseMemoryLibOptDxe/ScanMem16Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibOptDxe/ScanMem32Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibOptDxe/ScanMem64Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c | 7 ++++--- MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c | 3 ++- MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c | 2 +- MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c | 7 ++++--- MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c | 3 ++- MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c | 2 +- MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c | 7 ++++--- MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c | 3 ++- MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c | 2 +- MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c | 7 ++++--- MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c | 3 ++- MdePkg/Library/PeiMemoryLib/MemLibGuid.c | 2 +- MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c | 2 +- MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c | 2 +- MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c | 2 +- MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c | 7 ++++--- MdePkg/Library/PeiMemoryLib/SetMemWrapper.c | 3 ++- MdePkg/Library/UefiMemoryLib/MemLibGuid.c | 2 +- MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c | 2 +- MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c | 2 +- MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c | 2 +- MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c | 7 ++++--- MdePkg/Library/UefiMemoryLib/SetMemWrapper.c | 3 ++- 48 files changed, 80 insertions(+), 64 deletions(-) diff --git a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c index b315ff5322..737341023a 100644 --- a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c @@ -98,7 +98,7 @@ CompareGuid ( Scans a target buffer for a GUID, and returns a pointer to the matching GUID in the target buffer. - This function searches target the buffer specified by Buffer and Length from + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address at 128-bit increments for the 128-bit GUID value that matches Guid. If a match is found, then a pointer to the matching GUID in the target buffer is returned. If no match is found, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c index f8b3ab9763..1122fb536e 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 16-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c index d31b13f4d4..60d5eff683 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c @@ -28,7 +28,7 @@ Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 32-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c index 6d7acf3f7b..87d1643642 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 64-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c index 9efca5e02a..ecf1bdd2a7 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for an 8-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -65,7 +65,7 @@ ScanMem8 ( Scans a target buffer for a UINTN sized value, and returns a pointer to the matching UINTN sized value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a UINTN sized value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -92,7 +92,8 @@ ScanMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return ScanMem64 (Buffer, Length, (UINT64)Value); + } else { + return ScanMem32 (Buffer, Length, (UINT32)Value); } - return ScanMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c index f60691da40..e728175a5c 100644 --- a/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c @@ -85,6 +85,7 @@ SetMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return SetMem64 (Buffer, Length, (UINT64)Value); + } else { + return SetMem32 (Buffer, Length, (UINT32)Value); } - return SetMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c index b315ff5322..737341023a 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c @@ -98,7 +98,7 @@ CompareGuid ( Scans a target buffer for a GUID, and returns a pointer to the matching GUID in the target buffer. - This function searches target the buffer specified by Buffer and Length from + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address at 128-bit increments for the 128-bit GUID value that matches Guid. If a match is found, then a pointer to the matching GUID in the target buffer is returned. If no match is found, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c index f8b3ab9763..1122fb536e 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 16-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c index d31b13f4d4..60d5eff683 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c @@ -28,7 +28,7 @@ Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 32-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c index 6d7acf3f7b..87d1643642 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 64-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c index 9efca5e02a..ecf1bdd2a7 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for an 8-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -65,7 +65,7 @@ ScanMem8 ( Scans a target buffer for a UINTN sized value, and returns a pointer to the matching UINTN sized value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a UINTN sized value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -92,7 +92,8 @@ ScanMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return ScanMem64 (Buffer, Length, (UINT64)Value); + } else { + return ScanMem32 (Buffer, Length, (UINT32)Value); } - return ScanMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c index f60691da40..e728175a5c 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c @@ -85,6 +85,7 @@ SetMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return SetMem64 (Buffer, Length, (UINT64)Value); + } else { + return SetMem32 (Buffer, Length, (UINT32)Value); } - return SetMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c index b315ff5322..737341023a 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c @@ -98,7 +98,7 @@ CompareGuid ( Scans a target buffer for a GUID, and returns a pointer to the matching GUID in the target buffer. - This function searches target the buffer specified by Buffer and Length from + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address at 128-bit increments for the 128-bit GUID value that matches Guid. If a match is found, then a pointer to the matching GUID in the target buffer is returned. If no match is found, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem16Wrapper.c index f8b3ab9763..1122fb536e 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem16Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 16-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem32Wrapper.c index d31b13f4d4..60d5eff683 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem32Wrapper.c @@ -28,7 +28,7 @@ Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 32-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem64Wrapper.c index 6d7acf3f7b..87d1643642 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem64Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 64-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c index 9efca5e02a..ecf1bdd2a7 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for an 8-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -65,7 +65,7 @@ ScanMem8 ( Scans a target buffer for a UINTN sized value, and returns a pointer to the matching UINTN sized value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a UINTN sized value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -92,7 +92,8 @@ ScanMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return ScanMem64 (Buffer, Length, (UINT64)Value); + } else { + return ScanMem32 (Buffer, Length, (UINT32)Value); } - return ScanMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c index f60691da40..e728175a5c 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c @@ -85,6 +85,7 @@ SetMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return SetMem64 (Buffer, Length, (UINT64)Value); + } else { + return SetMem32 (Buffer, Length, (UINT32)Value); } - return SetMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c index b315ff5322..737341023a 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c @@ -98,7 +98,7 @@ CompareGuid ( Scans a target buffer for a GUID, and returns a pointer to the matching GUID in the target buffer. - This function searches target the buffer specified by Buffer and Length from + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address at 128-bit increments for the 128-bit GUID value that matches Guid. If a match is found, then a pointer to the matching GUID in the target buffer is returned. If no match is found, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c index f8b3ab9763..1122fb536e 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 16-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c index d31b13f4d4..60d5eff683 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem32Wrapper.c @@ -28,7 +28,7 @@ Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 32-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c index 6d7acf3f7b..87d1643642 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem64Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 64-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c index 9efca5e02a..ecf1bdd2a7 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for an 8-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -65,7 +65,7 @@ ScanMem8 ( Scans a target buffer for a UINTN sized value, and returns a pointer to the matching UINTN sized value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a UINTN sized value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -92,7 +92,8 @@ ScanMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return ScanMem64 (Buffer, Length, (UINT64)Value); + } else { + return ScanMem32 (Buffer, Length, (UINT32)Value); } - return ScanMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c index f60691da40..e728175a5c 100644 --- a/MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c @@ -85,6 +85,7 @@ SetMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return SetMem64 (Buffer, Length, (UINT64)Value); + } else { + return SetMem32 (Buffer, Length, (UINT32)Value); } - return SetMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c index b315ff5322..737341023a 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c @@ -98,7 +98,7 @@ CompareGuid ( Scans a target buffer for a GUID, and returns a pointer to the matching GUID in the target buffer. - This function searches target the buffer specified by Buffer and Length from + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address at 128-bit increments for the 128-bit GUID value that matches Guid. If a match is found, then a pointer to the matching GUID in the target buffer is returned. If no match is found, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c index f8b3ab9763..1122fb536e 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 16-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c index d31b13f4d4..60d5eff683 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c @@ -28,7 +28,7 @@ Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 32-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c index 6d7acf3f7b..87d1643642 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 64-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c index 9efca5e02a..ecf1bdd2a7 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for an 8-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -65,7 +65,7 @@ ScanMem8 ( Scans a target buffer for a UINTN sized value, and returns a pointer to the matching UINTN sized value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a UINTN sized value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -92,7 +92,8 @@ ScanMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return ScanMem64 (Buffer, Length, (UINT64)Value); + } else { + return ScanMem32 (Buffer, Length, (UINT32)Value); } - return ScanMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c index f60691da40..e728175a5c 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c @@ -85,6 +85,7 @@ SetMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return SetMem64 (Buffer, Length, (UINT64)Value); + } else { + return SetMem32 (Buffer, Length, (UINT32)Value); } - return SetMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c index b315ff5322..737341023a 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c @@ -98,7 +98,7 @@ CompareGuid ( Scans a target buffer for a GUID, and returns a pointer to the matching GUID in the target buffer. - This function searches target the buffer specified by Buffer and Length from + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address at 128-bit increments for the 128-bit GUID value that matches Guid. If a match is found, then a pointer to the matching GUID in the target buffer is returned. If no match is found, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c index f8b3ab9763..1122fb536e 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 16-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c index d31b13f4d4..60d5eff683 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c @@ -28,7 +28,7 @@ Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 32-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c index 6d7acf3f7b..87d1643642 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 64-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c index 9efca5e02a..ecf1bdd2a7 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for an 8-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -65,7 +65,7 @@ ScanMem8 ( Scans a target buffer for a UINTN sized value, and returns a pointer to the matching UINTN sized value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a UINTN sized value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -92,7 +92,8 @@ ScanMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return ScanMem64 (Buffer, Length, (UINT64)Value); + } else { + return ScanMem32 (Buffer, Length, (UINT32)Value); } - return ScanMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c index f60691da40..e728175a5c 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c @@ -85,6 +85,7 @@ SetMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return SetMem64 (Buffer, Length, (UINT64)Value); + } else { + return SetMem32 (Buffer, Length, (UINT32)Value); } - return SetMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c index b315ff5322..737341023a 100644 --- a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c @@ -98,7 +98,7 @@ CompareGuid ( Scans a target buffer for a GUID, and returns a pointer to the matching GUID in the target buffer. - This function searches target the buffer specified by Buffer and Length from + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address at 128-bit increments for the 128-bit GUID value that matches Guid. If a match is found, then a pointer to the matching GUID in the target buffer is returned. If no match is found, then NULL is returned. diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c index f8b3ab9763..1122fb536e 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 16-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c index d31b13f4d4..60d5eff683 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c @@ -28,7 +28,7 @@ Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 32-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c index 6d7acf3f7b..87d1643642 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 64-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c index 9efca5e02a..ecf1bdd2a7 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for an 8-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -65,7 +65,7 @@ ScanMem8 ( Scans a target buffer for a UINTN sized value, and returns a pointer to the matching UINTN sized value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a UINTN sized value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -92,7 +92,8 @@ ScanMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return ScanMem64 (Buffer, Length, (UINT64)Value); + } else { + return ScanMem32 (Buffer, Length, (UINT32)Value); } - return ScanMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c b/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c index f60691da40..e728175a5c 100644 --- a/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c @@ -85,6 +85,7 @@ SetMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return SetMem64 (Buffer, Length, (UINT64)Value); + } else { + return SetMem32 (Buffer, Length, (UINT32)Value); } - return SetMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/UefiMemoryLib/MemLibGuid.c b/MdePkg/Library/UefiMemoryLib/MemLibGuid.c index b315ff5322..737341023a 100644 --- a/MdePkg/Library/UefiMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/UefiMemoryLib/MemLibGuid.c @@ -98,7 +98,7 @@ CompareGuid ( Scans a target buffer for a GUID, and returns a pointer to the matching GUID in the target buffer. - This function searches target the buffer specified by Buffer and Length from + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address at 128-bit increments for the 128-bit GUID value that matches Guid. If a match is found, then a pointer to the matching GUID in the target buffer is returned. If no match is found, then NULL is returned. diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c index f8b3ab9763..1122fb536e 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 16-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c index d31b13f4d4..60d5eff683 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c @@ -28,7 +28,7 @@ Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 32-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c index 6d7acf3f7b..87d1643642 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a 64-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c index 9efca5e02a..ecf1bdd2a7 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c @@ -29,7 +29,7 @@ Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for an 8-bit value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -65,7 +65,7 @@ ScanMem8 ( Scans a target buffer for a UINTN sized value, and returns a pointer to the matching UINTN sized value in the target buffer. - This function searches target the buffer specified by Buffer and Length from the lowest + This function searches the target buffer specified by Buffer and Length from the lowest address to the highest address for a UINTN sized value that matches Value. If a match is found, then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. @@ -92,7 +92,8 @@ ScanMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return ScanMem64 (Buffer, Length, (UINT64)Value); + } else { + return ScanMem32 (Buffer, Length, (UINT32)Value); } - return ScanMem32 (Buffer, Length, (UINT32)Value); } diff --git a/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c b/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c index f60691da40..e728175a5c 100644 --- a/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c @@ -85,6 +85,7 @@ SetMemN ( { if (sizeof (UINTN) == sizeof (UINT64)) { return SetMem64 (Buffer, Length, (UINT64)Value); + } else { + return SetMem32 (Buffer, Length, (UINT32)Value); } - return SetMem32 (Buffer, Length, (UINT32)Value); } -- 2.39.2