]>
Commit | Line | Data |
---|---|---|
dd51a993 | 1 | /** @file\r |
2 | ZeroMem() implementation.\r | |
3 | \r | |
2bfb6009 | 4 | The following BaseMemoryLib instances contain the same copy of this file:\r |
dd51a993 | 5 | \r |
6 | BaseMemoryLib\r | |
7 | BaseMemoryLibMmx\r | |
8 | BaseMemoryLibSse2\r | |
9 | BaseMemoryLibRepStr\r | |
2bfb6009 LG |
10 | BaseMemoryLibOptDxe\r |
11 | BaseMemoryLibOptPei\r | |
dd51a993 | 12 | PeiMemoryLib\r |
1fef058f | 13 | UefiMemoryLib\r |
9095d37b LG |
14 | \r |
15 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
9344f092 | 16 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
dd51a993 | 17 | \r |
eb1c78db | 18 | **/\r |
1ece02b5 | 19 | \r |
dd51a993 | 20 | #include "MemLibInternals.h"\r |
21 | \r | |
22 | /**\r | |
23 | Fills a target buffer with zeros, and returns the target buffer.\r | |
24 | \r | |
25 | This function fills Length bytes of Buffer with zeros, and returns Buffer.\r | |
9095d37b | 26 | \r |
dd51a993 | 27 | If Length > 0 and Buffer is NULL, then ASSERT().\r |
cc4e0485 | 28 | If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r |
dd51a993 | 29 | \r |
2fc59a00 | 30 | @param Buffer The pointer to the target buffer to fill with zeros.\r |
31 | @param Length The number of bytes in Buffer to fill with zeros.\r | |
dd51a993 | 32 | \r |
33 | @return Buffer.\r | |
34 | \r | |
35 | **/\r | |
36 | VOID *\r | |
37 | EFIAPI\r | |
38 | ZeroMem (\r | |
39 | OUT VOID *Buffer,\r | |
40 | IN UINTN Length\r | |
41 | )\r | |
42 | {\r | |
12a37b2a AB |
43 | if (Length == 0) {\r |
44 | return Buffer;\r | |
45 | }\r | |
46 | \r | |
47 | ASSERT (Buffer != NULL);\r | |
dd51a993 | 48 | ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r |
49 | return InternalMemZeroMem (Buffer, Length);\r | |
50 | }\r |