diff --git a/ChangeLog b/ChangeLog index 065c3d362..6463c8521 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-13 Vladimir Serbinenko + + * grub-core/kern/arm/misc.S: Add __muldi3 and __aeabi_lmul. Those + helper functions are needed for thumb. + 2013-11-13 Vladimir Serbinenko * grub-core/disk/diskfilter.c (grub_diskfilter_make_raid): Make diff --git a/grub-core/kern/arm/misc.S b/grub-core/kern/arm/misc.S index 94522c222..8420a2aed 100644 --- a/grub-core/kern/arm/misc.S +++ b/grub-core/kern/arm/misc.S @@ -30,6 +30,33 @@ .align 2 +FUNCTION(__muldi3) +FUNCTION(__aeabi_lmul) + stmfd sp!, {r4, fp} + add fp, sp, #4 + sub sp, sp, #16 + str r0, [fp, #-12] + str r1, [fp, #-8] + str r2, [fp, #-20] + str r3, [fp, #-16] + ldr r3, [fp, #-8] + ldr r2, [fp, #-20] + .long 0xe0020293 @ mul r2, r3, r2 + ldr r3, [fp, #-16] + ldr r1, [fp, #-12] + .long 0xe0030391 @ mul r3, r1, r3 + add r2, r2, r3 + ldr r0, [fp, #-12] + ldr r1, [fp, #-20] + umull r3, r4, r0, r1 + add r2, r2, r4 + mov r4, r2 + mov r0, r3 + mov r1, r4 + sub sp, fp, #4 + ldmfd sp!, {r4, fp} + bx lr + .macro division parent stmfd sp!, {lr} diff --git a/include/grub/misc.h b/include/grub/misc.h index c62d4fbeb..8b0f33972 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -469,6 +469,12 @@ EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b); grub_uint32_t EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b); +/* Needed for allowing modules to be compiled as thumb. */ +grub_uint64_t +EXPORT_FUNC (__muldi3) (grub_uint64_t a, grub_uint64_t b); +grub_uint64_t +EXPORT_FUNC (__aeabi_lmul) (grub_uint64_t a, grub_uint64_t b); + #endif #if defined (__ia64__)