diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-12-15 15:01:58 +0000 |
---|---|---|
committer | abiesheuvel <abiesheuvel@Edk2> | 2015-12-15 15:01:58 +0000 |
commit | 19d9bf7725b9c0255e77e6656f2762d12887f70a (patch) | |
tree | 1328f460f8ee6b117f25f59da60b2ace3cf7aa85 /ArmPkg/Library/CompilerIntrinsicsLib | |
parent | 1a0db79125bad94aaaa97e1146100594a1471382 (diff) | |
download | edk2-platforms-19d9bf7725b9c0255e77e6656f2762d12887f70a.tar.xz |
ArmPkg/CompilerIntrinsicsLib: add GCC version of __aeabi_memset()
CLANG for ARM may emit calls to __aeabi_memset(), which is subtly different
from the default memset() [arguments 2 and 3 are reversed]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19281 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Library/CompilerIntrinsicsLib')
-rw-r--r-- | ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S index 0c7789eb58..bb75d7a70b 100644 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S +++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S @@ -15,8 +15,23 @@ .text
+ .syntax unified
.align 2
GCC_ASM_EXPORT (memset)
+ GCC_ASM_EXPORT (__aeabi_memset)
+
+# VOID
+# EFIAPI
+# __aeabi_memset (
+# IN VOID *Destination,
+# IN UINT32 Size
+# IN UINT32 Character,
+# );
+ASM_PFX(__aeabi_memset):
+ subs ip, r1, #0
+ bxeq lr
+ mov r1, r2
+ b L10
# VOID
# EFIAPI
@@ -26,13 +41,13 @@ # IN UINT32 Size
# );
ASM_PFX(memset):
- cmp r2, #0
+ subs ip, r2, #0
bxeq lr
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
L10:
strb r1, [r0], #1
- subs r2, r2, #1
+ subs ip, ip, #1
@ While size is not 0
bne L10
bx lr
|