TianoCore EDK2 master
CopyMemWrapper.c
Go to the documentation of this file.
1
20#include "MemLibInternals.h"
21
39VOID *
40EFIAPI
42 OUT VOID *DestinationBuffer,
43 IN CONST VOID *SourceBuffer,
44 IN UINTN Length
45 )
46{
47 if (Length == 0) {
48 return DestinationBuffer;
49 }
50
51 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
52 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
53
54 if (DestinationBuffer == SourceBuffer) {
55 return DestinationBuffer;
56 }
57
58 return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
59}
UINT64 UINTN
#define MAX_ADDRESS
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
#define ASSERT(Expression)
Definition: DebugLib.h:391
VOID *EFIAPI InternalMemCopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
Definition: CopyMem.c:28