]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S
65f6289b410bd73d2ac3300d83edaabddfbb07c3
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / memset.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 # Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
5 #
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
10 #
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 #
14 #------------------------------------------------------------------------------
15
16
17 .text
18 .syntax unified
19 .align 2
20 GCC_ASM_EXPORT (memset)
21 GCC_ASM_EXPORT (__aeabi_memset)
22
23 # VOID
24 # EFIAPI
25 # __aeabi_memset (
26 # IN VOID *Destination,
27 # IN UINT32 Size
28 # IN UINT32 Character,
29 # );
30 ASM_PFX(__aeabi_memset):
31 subs ip, r1, #0
32 bxeq lr
33 mov r1, r2
34 b L10
35
36 # VOID
37 # EFIAPI
38 # memset (
39 # IN VOID *Destination,
40 # IN UINT32 Character,
41 # IN UINT32 Size
42 # );
43 //
44 // This object may be pulled in to satisfy an undefined reference to
45 // __aeabi_memset above, but in some cases, memset() is already provided
46 // by another library (i.e., CryptoPkg/IntrinsicLib), in which case we
47 // prefer the other version. So allow this one to be overridden by
48 // giving it weak linkage.
49 //
50 .weak memset
51 ASM_PFX(memset):
52 subs ip, r2, #0
53 bxeq lr
54 @ args = 0, pretend = 0, frame = 0
55 @ frame_needed = 1, uses_anonymous_args = 0
56 L10:
57 strb r1, [r0], #1
58 subs ip, ip, #1
59 @ While size is not 0
60 bne L10
61 bx lr