]>
Commit | Line | Data |
---|---|---|
c5ecf6c1 | 1 | /** @file\r |
2 | SetMem() implementation.\r | |
3 | \r | |
2bfb6009 | 4 | The following BaseMemoryLib instances contain the same copy of this file:\r |
c5ecf6c1 | 5 | BaseMemoryLib\r |
6 | BaseMemoryLibMmx\r | |
7 | BaseMemoryLibSse2\r | |
8 | BaseMemoryLibRepStr\r | |
2bfb6009 LG |
9 | BaseMemoryLibOptDxe\r |
10 | BaseMemoryLibOptPei\r | |
c5ecf6c1 | 11 | PeiMemoryLib\r |
12 | DxeMemoryLib\r | |
13 | \r | |
d531bfee | 14 | Copyright (c) 2006, Intel Corporation<BR>\r |
15 | All rights reserved. This program and the accompanying materials\r | |
16 | are licensed and made available under the terms and conditions of the BSD License\r | |
17 | which accompanies this distribution. The full text of the license may be found at\r | |
18 | http://opensource.org/licenses/bsd-license.php\r | |
19 | \r | |
20 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
21 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
22 | \r | |
c5ecf6c1 | 23 | **/\r |
24 | \r | |
25 | #include "MemLibInternals.h"\r | |
26 | \r | |
27 | /**\r | |
28 | Fills a target buffer with a byte value, and returns the target buffer.\r | |
29 | \r | |
30 | This function fills Length bytes of Buffer with Value, and returns Buffer.\r | |
cc4e0485 | 31 | If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r |
c5ecf6c1 | 32 | \r |
33 | @param Buffer Memory to set.\r | |
34 | @param Length Number of bytes to set.\r | |
35 | @param Value Value of the set operation.\r | |
36 | \r | |
37 | @return Buffer.\r | |
38 | \r | |
39 | **/\r | |
40 | VOID *\r | |
41 | EFIAPI\r | |
42 | SetMem (\r | |
43 | OUT VOID *Buffer,\r | |
44 | IN UINTN Length,\r | |
45 | IN UINT8 Value\r | |
46 | )\r | |
47 | {\r | |
2bfb6009 | 48 | if (Length == 0) {\r |
c5ecf6c1 | 49 | return Buffer;\r |
50 | }\r | |
51 | \r | |
52 | ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r | |
53 | \r | |
54 | return InternalMemSetMem (Buffer, Length, Value);\r | |
55 | }\r |