]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm
ArmPkg: Rectify file modes
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / memmove.asm
CommitLineData
3402aac7 1//------------------------------------------------------------------------------\r
1e57a462 2//\r
284fb5c8 3// Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
1e57a462 4//\r
5// This program and the accompanying materials\r
6// are licensed and made available under the terms and conditions of the BSD License\r
7// which accompanies this distribution. The full text of the license may be found at\r
8// http://opensource.org/licenses/bsd-license.php\r
9//\r
10// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12//\r
13//------------------------------------------------------------------------------\r
14\r
15\r
1e57a462 16\r
efda1775 17 INCLUDE AsmMacroExport.inc\r
1e57a462 18\r
19;\r
20;VOID\r
21;EFIAPI\r
22;__aeabi_memmove (\r
23; IN VOID *Destination,\r
24; IN CONST VOID *Source,\r
25; IN UINT32 Size\r
26; );\r
27;\r
efda1775 28 RVCT_ASM_EXPORT __aeabi_memmove\r
1e57a462 29 CMP r2, #0\r
284fb5c8 30 BXEQ lr\r
1e57a462 31 CMP r0, r1\r
284fb5c8 32 BXEQ lr\r
1e57a462 33 BHI memmove_backward\r
1e57a462 34\r
35memmove_forward\r
36 LDRB r3, [r1], #1\r
37 STRB r3, [r0], #1\r
38 SUBS r2, r2, #1\r
284fb5c8
OM
39 BNE memmove_forward\r
40 BX lr\r
1e57a462 41\r
42memmove_backward\r
43 add r0, r2\r
44 add r1, r2\r
45memmove_backward_loop\r
284fb5c8
OM
46 LDRB r3, [r1, #-1]!\r
47 STRB r3, [r0, #-1]!\r
48 SUBS r2, r2, #1\r
49 BNE memmove_backward_loop\r
50 BX lr\r
1e57a462 51\r
52 END\r