]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm
ArmPkg: update RVCT assembly functions to use new RVCT_ASM_EXPORT macro
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / memmove.asm
1 //------------------------------------------------------------------------------
2 //
3 // Copyright (c) 2011-2014, ARM Limited. All rights reserved.
4 //
5 // 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
9 //
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.
12 //
13 //------------------------------------------------------------------------------
14
15
16
17 INCLUDE AsmMacroExport.inc
18
19 ;
20 ;VOID
21 ;EFIAPI
22 ;__aeabi_memmove (
23 ; IN VOID *Destination,
24 ; IN CONST VOID *Source,
25 ; IN UINT32 Size
26 ; );
27 ;
28 RVCT_ASM_EXPORT __aeabi_memmove
29 CMP r2, #0
30 BXEQ lr
31 CMP r0, r1
32 BXEQ lr
33 BHI memmove_backward
34
35 memmove_forward
36 LDRB r3, [r1], #1
37 STRB r3, [r0], #1
38 SUBS r2, r2, #1
39 BNE memmove_forward
40 BX lr
41
42 memmove_backward
43 add r0, r2
44 add r1, r2
45 memmove_backward_loop
46 LDRB r3, [r1, #-1]!
47 STRB r3, [r0, #-1]!
48 SUBS r2, r2, #1
49 BNE memmove_backward_loop
50 BX lr
51
52 END