]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibRepStr/IsZeroBufferWrapper.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibRepStr / IsZeroBufferWrapper.c
1 /** @file
2 Implementation of IsZeroBuffer function.
3
4 The following BaseMemoryLib instances contain the same copy of this file:
5
6 BaseMemoryLib
7 BaseMemoryLibMmx
8 BaseMemoryLibSse2
9 BaseMemoryLibRepStr
10 BaseMemoryLibOptDxe
11 BaseMemoryLibOptPei
12 PeiMemoryLib
13 UefiMemoryLib
14
15 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
16 SPDX-License-Identifier: BSD-2-Clause-Patent
17
18 **/
19
20 #include "MemLibInternals.h"
21
22 /**
23 Checks if the contents of a buffer are all zeros.
24
25 This function checks whether the contents of a buffer are all zeros. If the
26 contents are all zeros, return TRUE. Otherwise, return FALSE.
27
28 If Length > 0 and Buffer is NULL, then ASSERT().
29 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
30
31 @param Buffer The pointer to the buffer to be checked.
32 @param Length The size of the buffer (in bytes) to be checked.
33
34 @retval TRUE Contents of the buffer are all zeros.
35 @retval FALSE Contents of the buffer are not all zeros.
36
37 **/
38 BOOLEAN
39 EFIAPI
40 IsZeroBuffer (
41 IN CONST VOID *Buffer,
42 IN UINTN Length
43 )
44 {
45 ASSERT (!(Buffer == NULL && Length > 0));
46 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
47 return InternalMemIsZeroBuffer (Buffer, Length);
48 }