]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm
ARM Packages: Removed trailing spaces
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / memmove.asm
1 //------------------------------------------------------------------------------
2 //
3 // Copyright (c) 2011, 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 EXPORT __aeabi_memmove
17
18 AREA Memmove, CODE, READONLY
19
20 ;
21 ;VOID
22 ;EFIAPI
23 ;__aeabi_memmove (
24 ; IN VOID *Destination,
25 ; IN CONST VOID *Source,
26 ; IN UINT32 Size
27 ; );
28 ;
29 __aeabi_memmove
30 CMP r2, #0
31 BXEQ r14
32 CMP r0, r1
33 BXEQ r14
34 BHI memmove_backward
35 BLS memmove_forward
36
37 memmove_forward
38 LDRB r3, [r1], #1
39 STRB r3, [r0], #1
40 SUBS r2, r2, #1
41 BXEQ r14
42 B memmove_forward
43
44 memmove_backward
45 add r0, r2
46 add r1, r2
47 memmove_backward_loop
48 LDRB r3, [r1], #-1
49 STRB r3, [r0], #-1
50 SUBS r2, r2, #-1
51 BXEQ r14
52 B memmove_backward_loop
53
54 END