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