2009/9/1 Mikael Pettersson [off-list ref]:
?> Calculate this using the algorithm in arch/mips/kernel/time.c
?> they have a dynamically changing clocksource...
The algorithm always computes the largest shift/mult pair that
solves the equation:
? ? ? ?// 0 <= shift && shift <= 32
? ? ? ?u64 mult = ((u64)1E9 << shift) / hz;
? ? ? ?(mult >> 32) == 0
Can I assume that this is to minimize precision loss?
So I think, I asked the question of how to calculate div but noone
answered IIRC, then I found the MIPS code and it contained this
clue. Ralf Baechle from the MIPS camp wrote this code so lets
ask him.
Linus Walleij