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
This commit is contained in:
Ard Biesheuvel 2015-12-15 15:01:58 +00:00 committed by abiesheuvel
parent 1a0db79125
commit 19d9bf7725
1 changed files with 17 additions and 2 deletions

View File

@ -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