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