[U-Boot-Users] ARM missing __udivdi3 in lib_arm or fix 64bit division in nand_util.c?

Håvard Skinnemoen hskinnemoen at gmail.com
Tue Jul 31 10:17:57 CEST 2007


On 7/31/07, Dirk Behme <dirk.behme at googlemail.com> wrote:
> In lib_arm __udivsi3 and friends are available, but __udivdi3 is
> missing. There is a fix by modifying nand_util.c
>
> http://sourceforge.net/mailarchive/forum.php?thread_name=468D2650.10603%40rfo.atmel.com&forum_name=u-boot-users
>
> to not do any 64bit divisions any more. Now, I wonder what is the
> correct fix for this? Should lib_arm provide __udivdi3 as well or
> should nand_util.c be fixed as in above link to avoid 64bit divisions?

I can't speak for ARM, but I believe this is a problem for most
architectures. In general, I think we should seriously consider moving
lib_avr32/div64.c into lib_generic and start to use it for 64-bit
division instead of relying on libgcc. U-Boot NG has already done
this.

In this particular case, I think it's just ridiculously expensive to
do _three_ 64-bit divisions just to implement a simple progress bar
and they should all go away. It looks like Patrice's patch might give
a bit weird results when crossing a 4G boundary but I don't see any
easy way around it. Perhaps we should just drop the whole percentage
complete thing and just show a nice N / M fraction?

Håvard




More information about the U-Boot mailing list