[U-Boot] [RFC] Review of U-Boot timer API

Graeme Russ graeme.russ at gmail.com
Mon May 23 02:02:23 CEST 2011


Dear Reinhard,

On Sun, May 22, 2011 at 6:15 PM, Reinhard Meyer
<u-boot at emk-elektronik.de> wrote:
> Dear J. William Campbell,
>
> please demonstrate for me (and others), by a practical example,
> how _any_ arithmetic (even less with just shifts and multiplies)
> can convert a free running 3.576 MHz (wild example) free running
> 32 bit counter (maybe software extended to 64 bits) into a ms
> value that will properly wrap from 2**32-1 to 0 ?
>
> I fail to see how that will be possible...

These may help:

http://blogs.msdn.com/b/devdev/archive/2005/12/12/502980.aspx
http://www.hackersdelight.org/divcMore.pdf

of Google 'division of unsigned integer by a constant'

Basically you will be dividing by a constant value of 3576 which can be
highly optimised

Regards,

Graeme


More information about the U-Boot mailing list