Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
4ea9375a HT |
3 | Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | EfiSetMem.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Implementation of the EfiSetMem routine. This function is broken\r | |
19 | out into its own source file so that it can be excluded from a\r | |
20 | build for a particular platform easily if an optimized version \r | |
21 | is desired.\r | |
22 | \r | |
23 | --*/\r | |
24 | \r | |
25 | #include "Tiano.h"\r | |
26 | #include "EfiCommonLib.h"\r | |
27 | \r | |
28 | \r | |
29 | VOID\r | |
30 | EfiCommonLibSetMem (\r | |
31 | IN VOID *Buffer,\r | |
32 | IN UINTN Size,\r | |
33 | IN UINT8 Value\r | |
34 | )\r | |
35 | /*++\r | |
36 | \r | |
37 | Routine Description:\r | |
38 | \r | |
39 | Set Buffer to Value for Size bytes.\r | |
40 | \r | |
41 | Arguments:\r | |
42 | \r | |
43 | Buffer - Memory to set.\r | |
44 | \r | |
45 | Size - Number of bytes to set\r | |
46 | \r | |
47 | Value - Value of the set operation.\r | |
48 | \r | |
49 | Returns:\r | |
50 | \r | |
51 | None\r | |
52 | \r | |
53 | --*/\r | |
54 | {\r | |
55 | INT8 *Ptr;\r | |
56 | \r | |
57 | if (Value == 0) {\r | |
58 | EfiCommonLibZeroMem (Buffer, Size);\r | |
59 | } else {\r | |
60 | Ptr = Buffer;\r | |
61 | while (Size--) {\r | |
62 | *(Ptr++) = Value;\r | |
63 | }\r | |
64 | }\r | |
65 | }\r |