]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2004 - 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
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 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | SetMem.c\r | |
16 | \r | |
17 | Abstract: \r | |
18 | \r | |
19 | Internal SetMem\r | |
20 | \r | |
21 | --*/\r | |
22 | \r | |
23 | #include "BaseMemoryLibInternal.h"\r | |
24 | \r | |
25 | /**\r | |
26 | Set Buffer to Value for Size bytes.\r | |
27 | \r | |
28 | @param Buffer Memory to set.\r | |
29 | @param Size Number of bytes to set\r | |
30 | @param Value Value of the set operation.\r | |
31 | \r | |
32 | @return Buffer\r | |
33 | \r | |
34 | **/\r | |
35 | VOID *\r | |
36 | EFIAPI\r | |
37 | InternalMemSetMem (\r | |
38 | IN VOID *Buffer,\r | |
39 | IN UINTN Size,\r | |
40 | IN UINT8 Value\r | |
41 | )\r | |
42 | {\r | |
43 | //\r | |
44 | // Declare the local variables that actually move the data elements as\r | |
45 | // volatile to prevent the optimizer from replacing this function with\r | |
46 | // the intrinsic memset()\r | |
47 | //\r | |
48 | volatile UINT8 *Pointer;\r | |
49 | \r | |
50 | Pointer = (UINT8*)Buffer;\r | |
51 | while (Size-- != 0) {\r | |
52 | *(Pointer++) = Value;\r | |
53 | }\r | |
54 | return Buffer;\r | |
55 | }\r |