]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c
2 CopyMem() implementation.
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 Module Name: CopyMemWrapper.c
15 The following BaseMemoryLib instances share the same version of this file:
26 #include "MemLibInternals.h"
29 Copy Length bytes from Source to Destination.
31 This function copies Length bytes from SourceBuffer to DestinationBuffer, and
32 returns DestinationBuffer. The implementation must be reentrant, and it must
33 handle the case where SourceBuffer overlaps DestinationBuffer.
35 If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
37 If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
39 @param Destination Target of copy
40 @param Source Place to copy from
41 @param Length Number of bytes to copy
49 OUT VOID
*Destination
,
50 IN CONST VOID
*Source
,
55 Destination
== NULL
||
56 Length
<= MAX_ADDRESS
- (UINTN
)Destination
+ 1
60 Length
<= MAX_ADDRESS
- (UINTN
)Source
+ 1
62 if (Destination
== Source
|| Length
== 0) {
65 return InternalMemCopyMem (Destination
, Source
, Length
);