]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Base Memory Library functions implementation bases on Uefi Boot Service.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r | |
5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | \r | |
7 | **/\r | |
8 | \r | |
9 | #include "MemLibInternals.h"\r | |
10 | \r | |
11 | /**\r | |
12 | Copies a source buffer to a destination buffer, and returns the destination buffer.\r | |
13 | \r | |
14 | This function wraps the gBS->CopyMem().\r | |
15 | \r | |
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 | |
19 | \r | |
20 | @return DestinationBuffer.\r | |
21 | \r | |
22 | **/\r | |
23 | VOID *\r | |
24 | EFIAPI\r | |
25 | InternalMemCopyMem (\r | |
26 | OUT VOID *Destination,\r | |
27 | IN CONST VOID *Source,\r | |
28 | IN UINTN Length\r | |
29 | )\r | |
30 | {\r | |
31 | gBS->CopyMem (Destination, (VOID *)Source, Length);\r | |
32 | return Destination;\r | |
33 | }\r | |
34 | \r | |
35 | /**\r | |
36 | Fills a target buffer with a byte value, and returns the target buffer.\r | |
37 | \r | |
38 | This function wraps the gBS->SetMem().\r | |
39 | \r | |
40 | @param Buffer Memory to set.\r | |
41 | @param Size The number of bytes to set.\r | |
42 | @param Value Value of the set operation.\r | |
43 | \r | |
44 | @return Buffer.\r | |
45 | \r | |
46 | **/\r | |
47 | VOID *\r | |
48 | EFIAPI\r | |
49 | InternalMemSetMem (\r | |
50 | OUT VOID *Buffer,\r | |
51 | IN UINTN Size,\r | |
52 | IN UINT8 Value\r | |
53 | )\r | |
54 | {\r | |
55 | gBS->SetMem (Buffer, Size, Value);\r | |
56 | return Buffer;\r | |
57 | }\r |