]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/BaseMemoryLibStm/MemLibGeneric.c
BeagleBoardPkg: remove dependency on ArmPkg/BaseMemoryLibStm
[mirror_edk2.git] / ArmPkg / Library / BaseMemoryLibStm / MemLibGeneric.c
old mode 100755 (executable)
new mode 100644 (file)
index 54c2701..43fbcb6
@@ -262,3 +262,32 @@ InternalMemScanMem64 (
   } while (--Length != 0);\r
   return NULL;\r
 }\r
+\r
+/**\r
+  Checks whether the contents of a buffer are all zeros.\r
+\r
+  @param  Buffer  The pointer to the buffer to be checked.\r
+  @param  Length  The size of the buffer (in bytes) to be checked.\r
+\r
+  @retval TRUE    Contents of the buffer are all zeros.\r
+  @retval FALSE   Contents of the buffer are not all zeros.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+InternalMemIsZeroBuffer (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length\r
+  )\r
+{\r
+  CONST UINT8 *BufferData;\r
+  UINTN       Index;\r
+\r
+  BufferData = Buffer;\r
+  for (Index = 0; Index < Length; Index++) {\r
+    if (BufferData[Index] != 0) {\r
+      return FALSE;\r
+    }\r
+  }\r
+  return TRUE;\r
+}\r