]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add SetMemN() and ScanMemN() to the BaseMemoryLib class and all BaseMemoryLib impleme...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 5 Dec 2009 18:48:52 +0000 (18:48 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 5 Dec 2009 18:48:52 +0000 (18:48 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9517 6f19259b-4bc3-4df7-8a09-765794883524

17 files changed:
MdePkg/Include/Library/BaseMemoryLib.h
MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLib/SetMemWrapper.c
MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c
MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c
MdePkg/Library/BaseMemoryLibOptPei/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLibOptPei/SetMemWrapper.c
MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c
MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c
MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c
MdePkg/Library/PeiMemoryLib/SetMemWrapper.c
MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c
MdePkg/Library/UefiMemoryLib/SetMemWrapper.c

index 0247ddbb2d65b8a9efd4188f121516743743a0d7..47033d70a0974ec31b20e75dcbee17fa4548dd71 100644 (file)
@@ -147,6 +147,33 @@ SetMem64 (
   IN UINT64  Value\r
   );\r
 \r
+/**\r
+  Fills a target buffer with a value that is size UINTN, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the UINTN sized value specified by\r
+  Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMemN (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINTN  Value\r
+  );\r
+\r
 /**\r
   Fills a target buffer with zeros, and returns the target buffer.\r
 \r
@@ -312,6 +339,35 @@ ScanMem64 (
   IN UINT64      Value\r
   );\r
 \r
+/**\r
+  Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+  UINTN sized value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a UINTN sized value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  \r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMemN (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINTN       Value\r
+  );\r
+  \r
 /**\r
   Copies a source GUID to a destination GUID.\r
 \r
index 2add7849cd6240bf778257d692a8903fca4825c5..9efca5e02a40f5621b30ca314d511acd40e20541 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  ScanMem8() implementation.\r
+  ScanMem8() and ScanMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -60,3 +60,39 @@ ScanMem8 (
  \r
   return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+  UINTN sized value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a UINTN sized value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  \r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMemN (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINTN       Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return ScanMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return ScanMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
+\r
index b6bc1f43871af40b6b7da1ee62d9142d960fdbe8..f60691da406fb2fce8cb3984525821322ae586c6 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  SetMem() implementation.\r
+  SetMem() and SetMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -55,3 +55,36 @@ SetMem (
 \r
   return InternalMemSetMem (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Fills a target buffer with a value that is size UINTN, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the UINTN sized value specified by\r
+  Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMemN (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINTN  Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return SetMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return SetMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
index 2add7849cd6240bf778257d692a8903fca4825c5..9efca5e02a40f5621b30ca314d511acd40e20541 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  ScanMem8() implementation.\r
+  ScanMem8() and ScanMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -60,3 +60,39 @@ ScanMem8 (
  \r
   return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+  UINTN sized value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a UINTN sized value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  \r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMemN (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINTN       Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return ScanMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return ScanMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
+\r
index b6bc1f43871af40b6b7da1ee62d9142d960fdbe8..f60691da406fb2fce8cb3984525821322ae586c6 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  SetMem() implementation.\r
+  SetMem() and SetMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -55,3 +55,36 @@ SetMem (
 \r
   return InternalMemSetMem (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Fills a target buffer with a value that is size UINTN, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the UINTN sized value specified by\r
+  Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMemN (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINTN  Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return SetMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return SetMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
index 2add7849cd6240bf778257d692a8903fca4825c5..9efca5e02a40f5621b30ca314d511acd40e20541 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  ScanMem8() implementation.\r
+  ScanMem8() and ScanMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -60,3 +60,39 @@ ScanMem8 (
  \r
   return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+  UINTN sized value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a UINTN sized value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  \r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMemN (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINTN       Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return ScanMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return ScanMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
+\r
index b6bc1f43871af40b6b7da1ee62d9142d960fdbe8..f60691da406fb2fce8cb3984525821322ae586c6 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  SetMem() implementation.\r
+  SetMem() and SetMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -55,3 +55,36 @@ SetMem (
 \r
   return InternalMemSetMem (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Fills a target buffer with a value that is size UINTN, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the UINTN sized value specified by\r
+  Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMemN (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINTN  Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return SetMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return SetMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
index 2add7849cd6240bf778257d692a8903fca4825c5..9efca5e02a40f5621b30ca314d511acd40e20541 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  ScanMem8() implementation.\r
+  ScanMem8() and ScanMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -60,3 +60,39 @@ ScanMem8 (
  \r
   return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+  UINTN sized value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a UINTN sized value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  \r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMemN (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINTN       Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return ScanMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return ScanMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
+\r
index b6bc1f43871af40b6b7da1ee62d9142d960fdbe8..f60691da406fb2fce8cb3984525821322ae586c6 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  SetMem() implementation.\r
+  SetMem() and SetMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -55,3 +55,36 @@ SetMem (
 \r
   return InternalMemSetMem (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Fills a target buffer with a value that is size UINTN, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the UINTN sized value specified by\r
+  Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMemN (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINTN  Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return SetMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return SetMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
index 2add7849cd6240bf778257d692a8903fca4825c5..9efca5e02a40f5621b30ca314d511acd40e20541 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  ScanMem8() implementation.\r
+  ScanMem8() and ScanMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -60,3 +60,39 @@ ScanMem8 (
  \r
   return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+  UINTN sized value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a UINTN sized value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  \r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMemN (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINTN       Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return ScanMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return ScanMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
+\r
index b6bc1f43871af40b6b7da1ee62d9142d960fdbe8..f60691da406fb2fce8cb3984525821322ae586c6 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  SetMem() implementation.\r
+  SetMem() and SetMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -55,3 +55,36 @@ SetMem (
 \r
   return InternalMemSetMem (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Fills a target buffer with a value that is size UINTN, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the UINTN sized value specified by\r
+  Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMemN (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINTN  Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return SetMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return SetMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
index 2add7849cd6240bf778257d692a8903fca4825c5..9efca5e02a40f5621b30ca314d511acd40e20541 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  ScanMem8() implementation.\r
+  ScanMem8() and ScanMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -60,3 +60,39 @@ ScanMem8 (
  \r
   return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+  UINTN sized value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a UINTN sized value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  \r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMemN (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINTN       Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return ScanMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return ScanMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
+\r
index b6bc1f43871af40b6b7da1ee62d9142d960fdbe8..f60691da406fb2fce8cb3984525821322ae586c6 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  SetMem() implementation.\r
+  SetMem() and SetMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -55,3 +55,36 @@ SetMem (
 \r
   return InternalMemSetMem (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Fills a target buffer with a value that is size UINTN, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the UINTN sized value specified by\r
+  Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMemN (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINTN  Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return SetMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return SetMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
index 2add7849cd6240bf778257d692a8903fca4825c5..9efca5e02a40f5621b30ca314d511acd40e20541 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  ScanMem8() implementation.\r
+  ScanMem8() and ScanMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -60,3 +60,39 @@ ScanMem8 (
  \r
   return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+  UINTN sized value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a UINTN sized value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  \r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMemN (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINTN       Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return ScanMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return ScanMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
+\r
index b6bc1f43871af40b6b7da1ee62d9142d960fdbe8..f60691da406fb2fce8cb3984525821322ae586c6 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  SetMem() implementation.\r
+  SetMem() and SetMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -55,3 +55,36 @@ SetMem (
 \r
   return InternalMemSetMem (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Fills a target buffer with a value that is size UINTN, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the UINTN sized value specified by\r
+  Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMemN (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINTN  Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return SetMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return SetMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
index 2add7849cd6240bf778257d692a8903fca4825c5..9efca5e02a40f5621b30ca314d511acd40e20541 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  ScanMem8() implementation.\r
+  ScanMem8() and ScanMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -60,3 +60,39 @@ ScanMem8 (
  \r
   return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+  UINTN sized value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a UINTN sized value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  \r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMemN (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINTN       Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return ScanMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return ScanMem32 (Buffer, Length, (UINT32)Value);\r
+}\r
+\r
index b6bc1f43871af40b6b7da1ee62d9142d960fdbe8..f60691da406fb2fce8cb3984525821322ae586c6 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  SetMem() implementation.\r
+  SetMem() and SetMemN() implementation.\r
 \r
   The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
@@ -55,3 +55,36 @@ SetMem (
 \r
   return InternalMemSetMem (Buffer, Length, Value);\r
 }\r
+\r
+/**\r
+  Fills a target buffer with a value that is size UINTN, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the UINTN sized value specified by\r
+  Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
+  If Length is not aligned on a UINTN boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMemN (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINTN  Value\r
+  )\r
+{\r
+  if (sizeof (UINTN) == sizeof (UINT64)) {\r
+    return SetMem64 (Buffer, Length, (UINT64)Value);\r
+  }\r
+  return SetMem32 (Buffer, Length, (UINT32)Value);\r
+}\r