Revision: 19281
          http://sourceforge.net/p/edk2/code/19281
Author:   abiesheuvel
Date:     2015-12-15 15:01:58 +0000 (Tue, 15 Dec 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Leif Lindholm <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S

Modified: trunk/edk2/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S
===================================================================
--- trunk/edk2/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S        
2015-12-15 15:01:42 UTC (rev 19280)
+++ trunk/edk2/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S        
2015-12-15 15:01:58 UTC (rev 19281)
@@ -15,24 +15,39 @@
 
 
   .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
 # memset (
 #  IN  VOID    *Destination,
 #  IN  UINT32  Character,
 #  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


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to