at91dataflashboot-1.05-eabi-fixes.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Get at91dataflashboot to build with EABI toolchains, by providing the
  2. __aeabi_uidiv and __aeabi_uidivmod symbols. The code is based on
  3. U-Boot's code.
  4. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  5. ---
  6. _udivsi3.S | 14 ++++++++++++++
  7. 1 file changed, 14 insertions(+)
  8. Index: DataflashBoot-1.05/_udivsi3.S
  9. ===================================================================
  10. --- DataflashBoot-1.05.orig/_udivsi3.S
  11. +++ DataflashBoot-1.05/_udivsi3.S
  12. @@ -12,8 +12,11 @@
  13. .text
  14. .globl __udivsi3
  15. .type __udivsi3 ,function
  16. + .globl __aeabi_uidiv
  17. + .type __aeabi_uidiv ,function
  18. .align 0
  19. __udivsi3 :
  20. + __aeabi_uidiv:
  21. cmp divisor, #0
  22. beq Ldiv0
  23. mov curbit, #1
  24. @@ -68,6 +71,17 @@
  25. mov r0, #0 @ about as wrong as it could be
  26. ldmia sp!, {pc}
  27. .size __udivsi3 , . - __udivsi3
  28. +
  29. +.globl __aeabi_uidivmod
  30. +__aeabi_uidivmod:
  31. +
  32. + stmfd sp!, {r0, r1, ip, lr}
  33. + bl __aeabi_uidiv
  34. + ldmfd sp!, {r1, r2, ip, lr}
  35. + mul r3, r0, r2
  36. + sub r1, r1, r3
  37. + mov pc, lr
  38. +
  39. /* # 235 "libgcc1.S" */
  40. /* # 320 "libgcc1.S" */
  41. /* # 421 "libgcc1.S" */