From: Tom Rini Date: Sun, 15 Jan 2017 13:29:58 -0500 Subject: [U-Boot] [U-Boot, v2, 4/5] time: import time_after, time_before and friends from Linux In-Reply-To: <1482852963-6887-5-git-send-email-yamada.masahiro@socionext.com> References: <1482852963-6887-5-git-send-email-yamada.masahiro@socionext.com> Message-ID: <20170115182958.GT19689@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Dec 28, 2016 at 12:36:02AM +0900, Masahiro Yamada 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 > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: