]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiMemoryLib/MemLibGeneric.c
Detab
[mirror_edk2.git] / MdePkg / Library / UefiMemoryLib / MemLibGeneric.c
index ef9f358a7950b5eef35877b349b822d3dd5355bf..3ae03878835f82cfa1f4a2b3748298a80c2ab720 100644 (file)
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-  Module Name:  MemLibGeneric.c\r
-\r
-  The following BaseMemoryLib instances share the same version of this file:\r
+  The following BaseMemoryLib instances contain the same copy of this file:\r
 \r
     BaseMemoryLib\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
-/**\r
-  Set Buffer to Value for Size bytes.\r
-\r
-  @param  Buffer Memory to set.\r
-  @param  Size Number of bytes to set\r
-  @param  Value Value of the set operation.\r
-\r
-  @return Buffer\r
-\r
-**/\r
-VOID *\r
-EFIAPI\r
-InternalMemSetMem (\r
-  OUT     VOID                      *Buffer,\r
-  IN      UINTN                     Length,\r
-  IN      UINT8                     Value\r
-  );\r
+#include "MemLibInternals.h"\r
 \r
 /**\r
   Fills a target buffer with a 16-bit value, and returns the target buffer.\r
@@ -114,7 +96,7 @@ InternalMemSetMem64 (
   Set Buffer to 0 for Size bytes.\r
 \r
   @param  Buffer Memory to set.\r
-  @param  Size Number of bytes to set\r
+  @param  Length Number of bytes to set\r
 \r
   @return Buffer\r
 \r
@@ -137,7 +119,9 @@ InternalMemZeroMem (
   @param  Length            Length of DestinationBuffer and SourceBuffer memory\r
                             regions to compare. Must be non-zero.\r
 \r
-  @retval 0     if MemOne == MemTwo\r
+  @return 0                 All Length bytes of the two buffers are identical.\r
+  @retval Non-zero          The first mismatched byte in SourceBuffer subtracted from the first\r
+                            mismatched byte in DestinationBuffer.\r
 \r
 **/\r
 INTN\r
@@ -148,7 +132,6 @@ InternalMemCompareMem (
   IN      UINTN                     Length\r
   )\r
 {\r
-  ASSERT (Length > 0);\r
   while ((--Length != 0) &&\r
          (*(INT8*)DestinationBuffer == *(INT8*)SourceBuffer)) {\r
     DestinationBuffer = (INT8*)DestinationBuffer + 1;\r
@@ -178,7 +161,6 @@ InternalMemScanMem8 (
 {\r
   CONST UINT8                       *Pointer;\r
 \r
-  ASSERT (Length > 0);\r
   Pointer = (CONST UINT8*)Buffer;\r
   do {\r
     if (*(Pointer++) == Value) {\r
@@ -209,7 +191,6 @@ InternalMemScanMem16 (
 {\r
   CONST UINT16                      *Pointer;\r
 \r
-  ASSERT (Length > 0);\r
   Pointer = (CONST UINT16*)Buffer;\r
   do {\r
     if (*(Pointer++) == Value) {\r
@@ -240,7 +221,6 @@ InternalMemScanMem32 (
 {\r
   CONST UINT32                      *Pointer;\r
 \r
-  ASSERT (Length > 0);\r
   Pointer = (CONST UINT32*)Buffer;\r
   do {\r
     if (*(Pointer++) == Value) {\r
@@ -271,7 +251,6 @@ InternalMemScanMem64 (
 {\r
   CONST UINT64                      *Pointer;\r
 \r
-  ASSERT (Length > 0);\r
   Pointer = (CONST UINT64*)Buffer;\r
   do {\r
     if (*(Pointer++) == Value) {\r