ArmPkg/CompilerIntrinsicsLib: switch to ASM_FUNC() asm macro

Annotate functions with ASM_FUNC() so that they are emitted into
separate sections. Note that in some cases, various entry points
refer to different parts of the same routine, so in those cases,
the files have been left untouched.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
Ard Biesheuvel 2016-08-10 14:38:08 +02:00
parent 7589d9dbcf
commit 903e31242d
25 changed files with 58 additions and 115 deletions

View File

@ -26,16 +26,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <AsmMacroIoLibV8.h>
.text
.align 2
GCC_ASM_EXPORT(memcpy)
// Taken from Newlib BSD implementation. // Taken from Newlib BSD implementation.
ASM_PFX(memcpy): ASM_FUNC(memcpy)
// Copy dst to x6, so we can preserve return value. // Copy dst to x6, so we can preserve return value.
mov x6, x0 mov x6, x0

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__ashldi3)
ASM_PFX(__ashldi3): ASM_FUNC(__ashldi3)
cmp r2, #31 cmp r2, #31
bls L2 bls L2
cmp r2, #63 cmp r2, #63

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__ashrdi3)
ASM_PFX(__ashrdi3): ASM_FUNC(__ashrdi3)
cmp r2, #31 cmp r2, #31
bls L2 bls L2
cmp r2, #63 cmp r2, #63

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__clzsi2)
ASM_PFX(__clzsi2): ASM_FUNC(__clzsi2)
@ frame_needed = 1, uses_anonymous_args = 0 @ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {r7, lr} stmfd sp!, {r7, lr}
add r7, sp, #0 add r7, sp, #0

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__ctzsi2)
ASM_PFX(__ctzsi2): ASM_FUNC(__ctzsi2)
uxth r3, r0 uxth r3, r0
cmp r3, #0 cmp r3, #0
moveq ip, #16 moveq ip, #16

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__divdi3)
ASM_PFX(__divdi3): ASM_FUNC(__divdi3)
@ args = 0, pretend = 0, frame = 0 @ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0 @ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {r4, r5, r7, lr} stmfd sp!, {r4, r5, r7, lr}

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__divsi3)
ASM_PFX(__divsi3): ASM_FUNC(__divsi3)
eor r3, r0, r0, asr #31 eor r3, r0, r0, asr #31
eor r2, r1, r1, asr #31 eor r2, r1, r1, asr #31
stmfd sp!, {r4, r5, r7, lr} stmfd sp!, {r4, r5, r7, lr}

View File

@ -12,10 +12,7 @@
// //
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#include <AsmMacroIoLib.h>
.text
.align 2
GCC_ASM_EXPORT(__aeabi_ldivmod)
// //
// A pair of (unsigned) long longs is returned in {{r0, r1}, {r2, r3}}, // A pair of (unsigned) long longs is returned in {{r0, r1}, {r2, r3}},
@ -29,7 +26,7 @@
// )// // )//
// //
ASM_PFX(__aeabi_ldivmod): ASM_FUNC(__aeabi_ldivmod)
push {r4,lr} push {r4,lr}
asrs r4,r1,#1 asrs r4,r1,#1
eor r4,r4,r3,LSR #1 eor r4,r4,r3,LSR #1

View File

@ -12,10 +12,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h>
.text
.align 2
GCC_ASM_EXPORT(__aeabi_llsl)
# #
#VOID #VOID
@ -26,7 +23,7 @@ GCC_ASM_EXPORT(__aeabi_llsl)
# IN UINT32 Size # IN UINT32 Size
# ); # );
# #
ASM_PFX(__aeabi_llsl): ASM_FUNC(__aeabi_llsl)
subs r3,r2,#0x20 subs r3,r2,#0x20
bpl 1f bpl 1f
rsb r3,r2,#0x20 rsb r3,r2,#0x20

View File

@ -12,12 +12,8 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h>
.text
.align 2
GCC_ASM_EXPORT(__aeabi_llsr)
#
#VOID #VOID
#EFIAPI #EFIAPI
#__aeabi_llsr ( #__aeabi_llsr (
@ -26,7 +22,7 @@ GCC_ASM_EXPORT(__aeabi_llsr)
# IN UINT32 Size # IN UINT32 Size
# ); # );
# #
ASM_PFX(__aeabi_llsr): ASM_FUNC(__aeabi_llsr)
subs r3,r2,#0x20 subs r3,r2,#0x20
bpl 1f bpl 1f
rsb r3,r2,#0x20 rsb r3,r2,#0x20

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__lshrdi3)
ASM_PFX(__lshrdi3): ASM_FUNC(__lshrdi3)
cmp r2, #31 cmp r2, #31
bls L2 bls L2
cmp r2, #63 cmp r2, #63

View File

@ -12,9 +12,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT (memmove)
# VOID # VOID
# EFIAPI # EFIAPI
@ -23,7 +21,7 @@
# IN CONST VOID *Source, # IN CONST VOID *Source,
# IN UINT32 Size # IN UINT32 Size
# ); # );
ASM_PFX(memmove): ASM_FUNC(memmove)
CMP r2, #0 CMP r2, #0
BXEQ lr BXEQ lr
CMP r0, r1 CMP r0, r1

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__moddi3)
ASM_PFX(__moddi3): ASM_FUNC(__moddi3)
stmfd sp!, {r4, r5, r7, lr} stmfd sp!, {r4, r5, r7, lr}
mov r4, r1, asr #31 mov r4, r1, asr #31
add r7, sp, #8 add r7, sp, #8

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__modsi3)
ASM_PFX(__modsi3): ASM_FUNC(__modsi3)
stmfd sp!, {r4, r5, r7, lr} stmfd sp!, {r4, r5, r7, lr}
add r7, sp, #8 add r7, sp, #8
mov r5, r0 mov r5, r0

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__muldi3)
ASM_PFX(__muldi3): ASM_FUNC(__muldi3)
stmfd sp!, {r4, r5, r6, r7, lr} stmfd sp!, {r4, r5, r6, r7, lr}
add r7, sp, #12 add r7, sp, #12
stmfd sp!, {r8, r10, r11} stmfd sp!, {r8, r10, r11}

View File

@ -13,13 +13,11 @@
#**/ #**/
# #
.text #include <AsmMacroIoLib.h>
.syntax unified .syntax unified
.p2align 2
GCC_ASM_EXPORT(__switch16) ASM_FUNC(__switch16)
ASM_PFX(__switch16):
ldrh ip, [lr, #-1] ldrh ip, [lr, #-1]
cmp r0, ip cmp r0, ip
add r0, lr, r0, lsl #1 add r0, lr, r0, lsl #1

View File

@ -13,13 +13,11 @@
#**/ #**/
# #
.text #include <AsmMacroIoLib.h>
.syntax unified .syntax unified
.p2align 2
GCC_ASM_EXPORT(__switch32) ASM_FUNC(__switch32)
ASM_PFX(__switch32):
ldr ip, [lr, #-1] ldr ip, [lr, #-1]
cmp r0, ip cmp r0, ip
add r0, lr, r0, lsl #2 add r0, lr, r0, lsl #2

View File

@ -13,13 +13,11 @@
#**/ #**/
# #
.text #include <AsmMacroIoLib.h>
.syntax unified .syntax unified
.p2align 2
GCC_ASM_EXPORT(__switch8) ASM_FUNC(__switch8)
ASM_PFX(__switch8):
ldrb ip, [lr, #-1] ldrb ip, [lr, #-1]
cmp r0, ip cmp r0, ip
ldrsbcc r0, [lr, r0] ldrsbcc r0, [lr, r0]

View File

@ -13,14 +13,11 @@
#**/ #**/
# #
.text #include <AsmMacroIoLib.h>
.syntax unified .syntax unified
.p2align 2
GCC_ASM_EXPORT(__switchu8) ASM_FUNC(__switchu8)
ASM_PFX(__switchu8):
ldrb ip,[lr,#-1] ldrb ip,[lr,#-1]
cmp r0,ip cmp r0,ip
ldrbcc r0,[lr,r0] ldrbcc r0,[lr,r0]

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__ucmpdi2)
ASM_PFX(__ucmpdi2): ASM_FUNC(__ucmpdi2)
stmfd sp!, {r4, r5, r8, lr} stmfd sp!, {r4, r5, r8, lr}
cmp r1, r3 cmp r1, r3
mov r8, r0 mov r8, r0

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__udivdi3)
ASM_PFX(__udivdi3): ASM_FUNC(__udivdi3)
stmfd sp!, {r7, lr} stmfd sp!, {r7, lr}
add r7, sp, #0 add r7, sp, #0
sub sp, sp, #8 sub sp, sp, #8

View File

@ -12,12 +12,11 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.syntax unified
.align 2
GCC_ASM_EXPORT(__udivmoddi4)
ASM_PFX(__udivmoddi4): .syntax unified
ASM_FUNC(__udivmoddi4)
stmfd sp!, {r4, r5, r6, r7, lr} stmfd sp!, {r4, r5, r6, r7, lr}
add r7, sp, #12 add r7, sp, #12
stmfd sp!, {r10, r11} stmfd sp!, {r10, r11}

View File

@ -12,12 +12,11 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.syntax unified
.align 2
GCC_ASM_EXPORT(__udivsi3)
ASM_PFX(__udivsi3): .syntax unified
ASM_FUNC(__udivsi3)
cmp r1, #0 cmp r1, #0
cmpne r0, #0 cmpne r0, #0
stmfd sp!, {r4, r5, r7, lr} stmfd sp!, {r4, r5, r7, lr}

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__umoddi3)
ASM_PFX(__umoddi3): ASM_FUNC(__umoddi3)
stmfd sp!, {r7, lr} stmfd sp!, {r7, lr}
add r7, sp, #0 add r7, sp, #0
sub sp, sp, #16 sub sp, sp, #16

View File

@ -12,11 +12,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
.text #include <AsmMacroIoLib.h>
.align 2
GCC_ASM_EXPORT(__umodsi3)
ASM_PFX(__umodsi3): ASM_FUNC(__umodsi3)
stmfd sp!, {r4, r5, r7, lr} stmfd sp!, {r4, r5, r7, lr}
add r7, sp, #8 add r7, sp, #8
mov r5, r0 mov r5, r0