]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/CompilerIntrinsicsLib: add GCC version of __aeabi_memset()
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 15 Dec 2015 15:01:58 +0000 (15:01 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Tue, 15 Dec 2015 15:01:58 +0000 (15:01 +0000)
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

ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S

index 0c7789eb58165a982962eb00cab511c534881662..bb75d7a70b80c74004424e6c48c891463ac04687 100644 (file)
 \r
 \r
   .text\r
+  .syntax unified\r
   .align 2\r
   GCC_ASM_EXPORT (memset)\r
+  GCC_ASM_EXPORT (__aeabi_memset)\r
+\r
+# VOID\r
+# EFIAPI\r
+# __aeabi_memset (\r
+#  IN  VOID    *Destination,\r
+#  IN  UINT32  Size\r
+#  IN  UINT32  Character,\r
+#  );\r
+ASM_PFX(__aeabi_memset):\r
+  subs  ip, r1, #0\r
+  bxeq  lr\r
+  mov   r1, r2\r
+  b     L10\r
 \r
 # VOID\r
 # EFIAPI\r
 #  IN  UINT32  Size\r
 #  );\r
 ASM_PFX(memset):\r
-  cmp  r2, #0\r
+  subs ip, r2, #0\r
   bxeq lr\r
   @ args = 0, pretend = 0, frame = 0\r
   @ frame_needed = 1, uses_anonymous_args = 0\r
 L10:\r
   strb  r1, [r0], #1\r
-  subs  r2, r2, #1\r
+  subs  ip, ip, #1\r
   @ While size is not 0\r
   bne  L10\r
   bx   lr\r