On 27 December 2016 at 08:36, Masahiro Yamada
<yamada.masah...@socionext.com> wrote:
> It is not safe to compare timer values directly.
>
> On 32-bit systems, for example, timer_get_us() wraps around every
> 72 min. (2 ^ 32 / 1000000 =~ 4295 sec =~ 72 min).  Depending on
> the get_ticks() implementation, it may wrap more frequently.
> The 72 min might be possible on the use of U-Boot.
>
> Let's borrow time_after, time_before, and friends to solve the
> wrap-around problem.
>
> These macros were copied from include/linux/jiffies.h of Linux 4.9.
>
> Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
> ---
>
> Changes in v2: None
>
>  include/time.h | 41 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)

Reviewed-by: Simon Glass <s...@chromium.org>
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to