]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/PeiMemoryLib/MemLibInternals.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / PeiMemoryLib / MemLibInternals.h
index 11d846801a46ea7b3ba87d20ca24fc6b01e15872..c5e1e4dd6086831f5eb032dc5fa1d4658a7e7686 100644 (file)
@@ -1,32 +1,14 @@
 /** @file\r
   Declaration of internal functions for Base Memory Library.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  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
-  The following BaseMemoryLib instances contain the same copy of this file:\r
-\r
-    BaseMemoryLib\r
-    BaseMemoryLibMmx\r
-    BaseMemoryLibSse2\r
-    BaseMemoryLibRepStr\r
-    BaseMemoryLibOptDxe\r
-    BaseMemoryLibOptPei\r
-    PeiMemoryLib\r
-    DxeMemoryLib\r
+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 #ifndef __MEM_LIB_INTERNALS__\r
 #define __MEM_LIB_INTERNALS__\r
 \r
-\r
 #include <PiPei.h>\r
 \r
 #include <Library/BaseMemoryLib.h>\r
 /**\r
   Copies a source buffer to a destination buffer, and returns the destination buffer.\r
 \r
-  This function wraps the gPS->CopyMem ().\r
-  \r
-  @param  DestinationBuffer   Pointer to the destination buffer of the memory copy.\r
-  @param  SourceBuffer        Pointer to the source buffer of the memory copy.\r
-  @param  Length              Number of bytes to copy from SourceBuffer to DestinationBuffer.\r
+  This function wraps the (*PeiServices)->CopyMem ().\r
+\r
+  @param  DestinationBuffer   The pointer to the destination buffer of the memory copy.\r
+  @param  SourceBuffer        The pointer to the source buffer of the memory copy.\r
+  @param  Length              The number of bytes to copy from SourceBuffer to DestinationBuffer.\r
 \r
   @return DestinationBuffer.\r
 \r
 VOID *\r
 EFIAPI\r
 InternalMemCopyMem (\r
-  OUT     VOID                      *Destination,\r
-  IN      CONST VOID                *Source,\r
-  IN      UINTN                     Length\r
+  OUT     VOID        *Destination,\r
+  IN      CONST VOID  *Source,\r
+  IN      UINTN       Length\r
   );\r
 \r
 /**\r
   Fills a target buffer with a byte value, and returns the target buffer.\r
 \r
-  This function wraps the gPS->SetMem ().\r
-  \r
-  @param  Buffer    Memory to set.\r
-  @param  Size    Number of bytes to set.\r
+  This function wraps the (*PeiServices)->SetMem ().\r
+\r
+  @param  Buffer    The memory to set.\r
+  @param  Size      The number of bytes to set.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
@@ -69,17 +51,17 @@ InternalMemCopyMem (
 VOID *\r
 EFIAPI\r
 InternalMemSetMem (\r
-  OUT     VOID                      *Buffer,\r
-  IN      UINTN                     Size,\r
-  IN      UINT8                     Value\r
+  OUT     VOID   *Buffer,\r
+  IN      UINTN  Size,\r
+  IN      UINT8  Value\r
   );\r
 \r
 /**\r
   Fills a target buffer with a 16-bit value, and returns the target buffer.\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
+  @param  Buffer  The pointer to the target buffer to fill.\r
+  @param  Length  The count of 16-bit value to fill.\r
+  @param  Value   The value with which to fill Length bytes of Buffer.\r
 \r
   @return Buffer\r
 \r
@@ -87,17 +69,17 @@ InternalMemSetMem (
 VOID *\r
 EFIAPI\r
 InternalMemSetMem16 (\r
-  OUT     VOID                      *Buffer,\r
-  IN      UINTN                     Length,\r
-  IN      UINT16                    Value\r
+  OUT     VOID    *Buffer,\r
+  IN      UINTN   Length,\r
+  IN      UINT16  Value\r
   );\r
 \r
 /**\r
   Fills a target buffer with a 32-bit value, and returns the target buffer.\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
+  @param  Buffer  The pointer to the target buffer to fill.\r
+  @param  Length  The count of 32-bit value to fill.\r
+  @param  Value   The value with which to fill Length bytes of Buffer.\r
 \r
   @return Buffer\r
 \r
@@ -105,17 +87,17 @@ InternalMemSetMem16 (
 VOID *\r
 EFIAPI\r
 InternalMemSetMem32 (\r
-  OUT     VOID                      *Buffer,\r
-  IN      UINTN                     Length,\r
-  IN      UINT32                    Value\r
+  OUT     VOID    *Buffer,\r
+  IN      UINTN   Length,\r
+  IN      UINT32  Value\r
   );\r
 \r
 /**\r
   Fills a target buffer with a 64-bit value, and returns the target buffer.\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
+  @param  Buffer  The pointer to the target buffer to fill.\r
+  @param  Length  The count of 64-bit value to fill.\r
+  @param  Value   The value with which to fill Length bytes of Buffer.\r
 \r
   @return Buffer\r
 \r
@@ -123,16 +105,16 @@ InternalMemSetMem32 (
 VOID *\r
 EFIAPI\r
 InternalMemSetMem64 (\r
-  OUT     VOID                      *Buffer,\r
-  IN      UINTN                     Length,\r
-  IN      UINT64                    Value\r
+  OUT     VOID    *Buffer,\r
+  IN      UINTN   Length,\r
+  IN      UINT64  Value\r
   );\r
 \r
 /**\r
   Set Buffer to 0 for Size bytes.\r
 \r
-  @param  Buffer Memory to set.\r
-  @param  Length Number of bytes to set\r
+  @param  Buffer The memory to set.\r
+  @param  Length The number of bytes to set\r
 \r
   @return Buffer\r
 \r
@@ -140,16 +122,16 @@ InternalMemSetMem64 (
 VOID *\r
 EFIAPI\r
 InternalMemZeroMem (\r
-  OUT     VOID                      *Buffer,\r
-  IN      UINTN                     Length\r
+  OUT     VOID   *Buffer,\r
+  IN      UINTN  Length\r
   );\r
 \r
 /**\r
   Compares two memory buffers of a given length.\r
 \r
-  @param  DestinationBuffer First memory buffer\r
-  @param  SourceBuffer      Second memory buffer\r
-  @param  Length            Length of DestinationBuffer and SourceBuffer memory\r
+  @param  DestinationBuffer The first memory buffer\r
+  @param  SourceBuffer      The second memory buffer\r
+  @param  Length            The length of DestinationBuffer and SourceBuffer memory\r
                             regions to compare. Must be non-zero.\r
 \r
   @return 0                 All Length bytes of the two buffers are identical.\r
@@ -160,85 +142,102 @@ InternalMemZeroMem (
 INTN\r
 EFIAPI\r
 InternalMemCompareMem (\r
-  IN      CONST VOID                *DestinationBuffer,\r
-  IN      CONST VOID                *SourceBuffer,\r
-  IN      UINTN                     Length\r
+  IN      CONST VOID  *DestinationBuffer,\r
+  IN      CONST VOID  *SourceBuffer,\r
+  IN      UINTN       Length\r
   );\r
 \r
 /**\r
   Scans a target buffer for an 8-bit value, and returns a pointer to the\r
   matching 8-bit value in the target buffer.\r
 \r
-  @param  Buffer  Pointer to the target buffer to scan.\r
-  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
-  @param  Value   Value to search for in the target buffer.\r
+  @param  Buffer  The pointer to the target buffer to scan.\r
+  @param  Length  The count of 8-bit value to scan. Must be non-zero.\r
+  @param  Value   The value to search for in the target buffer.\r
 \r
-  @return Pointer to the first occurrence or NULL if not found.\r
+  @return The pointer to the first occurrence, or NULL if not found.\r
 \r
 **/\r
 CONST VOID *\r
 EFIAPI\r
 InternalMemScanMem8 (\r
-  IN      CONST VOID                *Buffer,\r
-  IN      UINTN                     Length,\r
-  IN      UINT8                     Value\r
+  IN      CONST VOID  *Buffer,\r
+  IN      UINTN       Length,\r
+  IN      UINT8       Value\r
   );\r
 \r
 /**\r
   Scans a target buffer for a 16-bit value, and returns a pointer to the\r
   matching 16-bit value in the target buffer.\r
 \r
-  @param  Buffer  Pointer to the target buffer to scan.\r
-  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
-  @param  Value   Value to search for in the target buffer.\r
+  @param  Buffer  The pointer to the target buffer to scan.\r
+  @param  Length  The count of 16-bit value to scan. Must be non-zero.\r
+  @param  Value   The value to search for in the target buffer.\r
 \r
-  @return Pointer to the first occurrence or NULL if not found.\r
+  @return The pointer to the first occurrence, or NULL if not found.\r
 \r
 **/\r
 CONST VOID *\r
 EFIAPI\r
 InternalMemScanMem16 (\r
-  IN      CONST VOID                *Buffer,\r
-  IN      UINTN                     Length,\r
-  IN      UINT16                    Value\r
+  IN      CONST VOID  *Buffer,\r
+  IN      UINTN       Length,\r
+  IN      UINT16      Value\r
   );\r
 \r
 /**\r
   Scans a target buffer for a 32-bit value, and returns a pointer to the\r
   matching 32-bit value in the target buffer.\r
 \r
-  @param  Buffer  Pointer to the target buffer to scan.\r
-  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
-  @param  Value   Value to search for in the target buffer.\r
+  @param  Buffer  The pointer to the target buffer to scan.\r
+  @param  Length  The count of 32-bit value to scan. Must be non-zero.\r
+  @param  Value   The value to search for in the target buffer.\r
 \r
-  @return Pointer to the first occurrence or NULL if not found.\r
+  @return The pointer to the first occurrence, or NULL if not found.\r
 \r
 **/\r
 CONST VOID *\r
 EFIAPI\r
 InternalMemScanMem32 (\r
-  IN      CONST VOID                *Buffer,\r
-  IN      UINTN                     Length,\r
-  IN      UINT32                    Value\r
+  IN      CONST VOID  *Buffer,\r
+  IN      UINTN       Length,\r
+  IN      UINT32      Value\r
   );\r
 \r
 /**\r
   Scans a target buffer for a 64-bit value, and returns a pointer to the\r
   matching 64-bit value in the target buffer.\r
 \r
-  @param  Buffer  Pointer to the target buffer to scan.\r
-  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
-  @param  Value   Value to search for in the target buffer.\r
+  @param  Buffer  The pointer to the target buffer to scan.\r
+  @param  Length  The count of 64-bit value to scan. Must be non-zero.\r
+  @param  Value   The value to search for in the target buffer.\r
 \r
-  @return Pointer to the first occurrence or NULL if not found.\r
+  @return The pointer to the first occurrence, or NULL if not found.\r
 \r
 **/\r
 CONST VOID *\r
 EFIAPI\r
 InternalMemScanMem64 (\r
-  IN      CONST VOID                *Buffer,\r
-  IN      UINTN                     Length,\r
-  IN      UINT64                    Value\r
+  IN      CONST VOID  *Buffer,\r
+  IN      UINTN       Length,\r
+  IN      UINT64      Value\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
 #endif\r