]>
Commit | Line | Data |
---|---|---|
02b5cf7f HW |
1 | /** @file\r |
2 | Implementation of IsZeroBuffer function.\r | |
3 | \r | |
4 | The following BaseMemoryLib instances contain the same copy of this file:\r | |
5 | \r | |
6 | BaseMemoryLib\r | |
7 | BaseMemoryLibMmx\r | |
8 | BaseMemoryLibSse2\r | |
9 | BaseMemoryLibRepStr\r | |
10 | BaseMemoryLibOptDxe\r | |
11 | BaseMemoryLibOptPei\r | |
12 | PeiMemoryLib\r | |
13 | UefiMemoryLib\r | |
14 | \r | |
15 | Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r | |
16 | This program and the accompanying materials\r | |
17 | are licensed and made available under the terms and conditions of the BSD License\r | |
18 | which accompanies this distribution. The full text of the license may be found at\r | |
19 | http://opensource.org/licenses/bsd-license.php\r | |
20 | \r | |
21 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
22 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
23 | \r | |
24 | **/\r | |
25 | \r | |
26 | #include "MemLibInternals.h"\r | |
27 | \r | |
28 | /**\r | |
29 | Checks if the contents of a buffer are all zeros.\r | |
30 | \r | |
31 | This function checks whether the contents of a buffer are all zeros. If the\r | |
32 | contents are all zeros, return TRUE. Otherwise, return FALSE.\r | |
33 | \r | |
34 | If Length > 0 and Buffer is NULL, then ASSERT().\r | |
35 | If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r | |
36 | \r | |
37 | @param Buffer The pointer to the buffer to be checked.\r | |
38 | @param Length The size of the buffer (in bytes) to be checked.\r | |
39 | \r | |
40 | @retval TRUE Contents of the buffer are all zeros.\r | |
41 | @retval FALSE Contents of the buffer are not all zeros.\r | |
42 | \r | |
43 | **/\r | |
44 | BOOLEAN\r | |
45 | EFIAPI\r | |
46 | IsZeroBuffer (\r | |
47 | IN CONST VOID *Buffer,\r | |
48 | IN UINTN Length\r | |
49 | )\r | |
50 | {\r | |
51 | ASSERT (!(Buffer == NULL && Length > 0));\r | |
52 | ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r | |
53 | return InternalMemIsZeroBuffer (Buffer, Length);\r | |
54 | }\r |