]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Base Memory Library functions implementation bases on PeiServcie.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php.\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #include "MemLibInternals.h"\r | |
16 | \r | |
17 | /**\r | |
18 | Copies a source buffer to a destination buffer, and returns the destination buffer.\r | |
19 | \r | |
20 | This function wraps the gPS->CopyMem ().\r | |
21 | \r | |
22 | @param DestinationBuffer The pointer to the destination buffer of the memory copy.\r | |
23 | @param SourceBuffer The pointer to the source buffer of the memory copy.\r | |
24 | @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.\r | |
25 | \r | |
26 | @return DestinationBuffer.\r | |
27 | \r | |
28 | **/\r | |
29 | VOID *\r | |
30 | EFIAPI\r | |
31 | InternalMemCopyMem (\r | |
32 | OUT VOID *Destination,\r | |
33 | IN CONST VOID *Source,\r | |
34 | IN UINTN Length\r | |
35 | )\r | |
36 | {\r | |
37 | (*GetPeiServicesTablePointer ())->CopyMem (\r | |
38 | Destination,\r | |
39 | (VOID*)Source,\r | |
40 | Length\r | |
41 | );\r | |
42 | return Destination;\r | |
43 | }\r | |
44 | \r | |
45 | /**\r | |
46 | Fills a target buffer with a byte value, and returns the target buffer.\r | |
47 | \r | |
48 | This function wraps the gPS->SetMem ().\r | |
49 | \r | |
50 | @param Buffer Memory to set.\r | |
51 | @param Size The number of bytes to set.\r | |
52 | @param Value Value of the set operation.\r | |
53 | \r | |
54 | @return Buffer.\r | |
55 | \r | |
56 | **/\r | |
57 | VOID *\r | |
58 | EFIAPI\r | |
59 | InternalMemSetMem (\r | |
60 | OUT VOID *Buffer,\r | |
61 | IN UINTN Size,\r | |
62 | IN UINT8 Value\r | |
63 | )\r | |
64 | {\r | |
65 | (*GetPeiServicesTablePointer ())->SetMem (\r | |
66 | Buffer,\r | |
67 | Size,\r | |
68 | Value\r | |
69 | );\r | |
70 | return Buffer;\r | |
71 | }\r |