]>
Commit | Line | Data |
---|---|---|
dd51a993 | 1 | /** @file\r |
cc4e0485 | 2 | Base Memory Library functions implementation bases on PeiServcie.\r |
dd51a993 | 3 | \r |
9095d37b | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
dd51a993 | 6 | \r |
dd51a993 | 7 | **/\r |
8 | \r | |
9 | #include "MemLibInternals.h"\r | |
10 | \r | |
f80b0830 | 11 | /**\r |
12 | Copies a source buffer to a destination buffer, and returns the destination buffer.\r | |
13 | \r | |
14 | This function wraps the gPS->CopyMem ().\r | |
9095d37b | 15 | \r |
2fc59a00 | 16 | @param DestinationBuffer The pointer to the destination buffer of the memory copy.\r |
17 | @param SourceBuffer The pointer to the source buffer of the memory copy.\r | |
18 | @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.\r | |
f80b0830 | 19 | \r |
20 | @return DestinationBuffer.\r | |
21 | \r | |
22 | **/\r | |
dd51a993 | 23 | VOID *\r |
24 | EFIAPI\r | |
25 | InternalMemCopyMem (\r | |
2f88bd3a MK |
26 | OUT VOID *Destination,\r |
27 | IN CONST VOID *Source,\r | |
28 | IN UINTN Length\r | |
dd51a993 | 29 | )\r |
30 | {\r | |
31 | (*GetPeiServicesTablePointer ())->CopyMem (\r | |
32 | Destination,\r | |
2f88bd3a | 33 | (VOID *)Source,\r |
dd51a993 | 34 | Length\r |
35 | );\r | |
36 | return Destination;\r | |
37 | }\r | |
38 | \r | |
f80b0830 | 39 | /**\r |
40 | Fills a target buffer with a byte value, and returns the target buffer.\r | |
41 | \r | |
42 | This function wraps the gPS->SetMem ().\r | |
9095d37b | 43 | \r |
f80b0830 | 44 | @param Buffer Memory to set.\r |
58380e9c | 45 | @param Size The number of bytes to set.\r |
f80b0830 | 46 | @param Value Value of the set operation.\r |
47 | \r | |
48 | @return Buffer.\r | |
49 | \r | |
50 | **/\r | |
dd51a993 | 51 | VOID *\r |
52 | EFIAPI\r | |
53 | InternalMemSetMem (\r | |
2f88bd3a MK |
54 | OUT VOID *Buffer,\r |
55 | IN UINTN Size,\r | |
56 | IN UINT8 Value\r | |
dd51a993 | 57 | )\r |
58 | {\r | |
59 | (*GetPeiServicesTablePointer ())->SetMem (\r | |
60 | Buffer,\r | |
61 | Size,\r | |
62 | Value\r | |
63 | );\r | |
64 | return Buffer;\r | |
65 | }\r |