]> git.baikalelectronics.ru Git - uboot.git/commit
timer: Allow delays with a 32-bit microsecond timer
authorSimon Glass <sjg@chromium.org>
Fri, 10 Jul 2020 00:43:14 +0000 (18:43 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 17 Jul 2020 06:32:24 +0000 (14:32 +0800)
commitc08e5ead286e93495c32ce5096e6aa2cd80162c3
tree1361a00a2d8d7a282be4e6c529539ecd8acabc70
parent61ec4f0bee459870b87d7711b0372c5c54408bca
timer: Allow delays with a 32-bit microsecond timer

The current get_timer_us() uses 64-bit arithmetic on 32-bit machines.
When implementing microsecond-level timeouts, 32-bits is plenty. Add a
new function that uses an unsigned long. On 64-bit machines this is
still 64-bit, but this doesn't introduce a penalty. On 32-bit machines
it is more efficient.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
include/time.h
lib/time.c