X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=inline;f=arch%2Farm%2Flib%2Flib1funcs.S;h=6e29cbf2ab825616788c92b6f16489c33d23b328;hb=b07d044d5bfa8c440b172eb3f8a9d537f82e21b6;hp=c343ea91e2bffef9437988cfc4bfde2aed105a70;hpb=40d67c75e47e2e76cc310515c55d758151b9fdde;p=u-boot diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S index c343ea91e2..6e29cbf2ab 100644 --- a/arch/arm/lib/lib1funcs.S +++ b/arch/arm/lib/lib1funcs.S @@ -193,6 +193,7 @@ .endm +.pushsection .text.__udivsi3, "ax" ENTRY(__udivsi3) ENTRY(__aeabi_uidiv) UNWIND(.fnstart) @@ -222,7 +223,9 @@ UNWIND(.fnstart) UNWIND(.fnend) ENDPROC(__udivsi3) ENDPROC(__aeabi_uidiv) +.popsection +.pushsection .text.__umodsi3, "ax" ENTRY(__umodsi3) UNWIND(.fnstart) @@ -240,7 +243,9 @@ UNWIND(.fnstart) UNWIND(.fnend) ENDPROC(__umodsi3) +.popsection +.pushsection .text.__divsi3, "ax" ENTRY(__divsi3) ENTRY(__aeabi_idiv) UNWIND(.fnstart) @@ -283,7 +288,9 @@ UNWIND(.fnstart) UNWIND(.fnend) ENDPROC(__divsi3) ENDPROC(__aeabi_idiv) +.popsection +.pushsection .text.__modsi3, "ax" ENTRY(__modsi3) UNWIND(.fnstart) @@ -307,9 +314,11 @@ UNWIND(.fnstart) UNWIND(.fnend) ENDPROC(__modsi3) +.popsection #ifdef CONFIG_AEABI +.pushsection .text.__aeabi_uidivmod, "ax" ENTRY(__aeabi_uidivmod) UNWIND(.fnstart) UNWIND(.save {r0, r1, ip, lr} ) @@ -323,10 +332,13 @@ UNWIND(.save {r0, r1, ip, lr} ) UNWIND(.fnend) ENDPROC(__aeabi_uidivmod) +.popsection +.pushsection .text.__aeabi_uidivmod, "ax" ENTRY(__aeabi_idivmod) UNWIND(.fnstart) UNWIND(.save {r0, r1, ip, lr} ) + stmfd sp!, {r0, r1, ip, lr} bl __aeabi_idiv ldmfd sp!, {r1, r2, ip, lr} @@ -336,16 +348,82 @@ UNWIND(.save {r0, r1, ip, lr} ) UNWIND(.fnend) ENDPROC(__aeabi_idivmod) +.popsection #endif +.pushsection .text.Ldiv0, "ax" Ldiv0: UNWIND(.fnstart) UNWIND(.pad #4) UNWIND(.save {lr}) + str lr, [sp, #-8]! bl __div0 mov r0, #0 @ About as wrong as it could be. ldr pc, [sp], #8 + UNWIND(.fnend) ENDPROC(Ldiv0) +.popsection + +/* Thumb-1 specialities */ +#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD) && !defined(CONFIG_HAS_THUMB2) +.pushsection .text.__gnu_thumb1_case_sqi, "ax" +ENTRY(__gnu_thumb1_case_sqi) + push {r1} + mov r1, lr + lsrs r1, r1, #1 + lsls r1, r1, #1 + ldrsb r1, [r1, r0] + lsls r1, r1, #1 + add lr, lr, r1 + pop {r1} + bx lr +ENDPROC(__gnu_thumb1_case_sqi) +.popsection + +.pushsection .text.__gnu_thumb1_case_uqi, "ax" +ENTRY(__gnu_thumb1_case_uqi) + push {r1} + mov r1, lr + lsrs r1, r1, #1 + lsls r1, r1, #1 + ldrb r1, [r1, r0] + lsls r1, r1, #1 + add lr, lr, r1 + pop {r1} + bx lr +ENDPROC(__gnu_thumb1_case_uqi) +.popsection + +.pushsection .text.__gnu_thumb1_case_shi, "ax" +ENTRY(__gnu_thumb1_case_shi) + push {r0, r1} + mov r1, lr + lsrs r1, r1, #1 + lsls r0, r0, #1 + lsls r1, r1, #1 + ldrsh r1, [r1, r0] + lsls r1, r1, #1 + add lr, lr, r1 + pop {r0, r1} + bx lr +ENDPROC(__gnu_thumb1_case_shi) +.popsection + +.pushsection .text.__gnu_thumb1_case_uhi, "ax" +ENTRY(__gnu_thumb1_case_uhi) + push {r0, r1} + mov r1, lr + lsrs r1, r1, #1 + lsls r0, r0, #1 + lsls r1, r1, #1 + ldrh r1, [r1, r0] + lsls r1, r1, #1 + add lr, lr, r1 + pop {r0, r1} + bx lr +ENDPROC(__gnu_thumb1_case_uhi) +.popsection +#endif