
Dear ALL,
it still escapes me why everyone tries to make things so complicated INSIDE the loop.
Why not just define an API like this:
u32 timeout = make_timeout(5); /* minimum 5 millisecond timeout */ u32 start = get_timer();
while ((get_timer() - start) < timeout) ...
make_timeout() can be arch/soc/platform specific and take into account to return at least such a value that the timeout is never cut short. (In case of a 10 ms NIOS timer, make_timeout(5) would have to return the value 20, resulting in a real timeout of at least 10 ms but upto 20 ms )
If anyone sees the need, make_timeout (or what ever it might be called) could have a second parameter, indicating whether round up or round down is desired.
...
I also agree to remove the parameter of get_timer(), but we should also get rid of CONFIG_SYS_HZ.
Reinhard