diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-15 20:20:12 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-15 20:20:12 +0100 |
commit | bc01035f223d08929459518de3e0ea52be2c961c (patch) | |
tree | d1edfc99e060c97c90fc755da43f692c68389a1b /common | |
parent | c06fca0f8434f34e12a04a39496d2716ad9b262c (diff) | |
parent | 5099f5e15cca61faeb82beff102dfd5ba3941ee6 (diff) | |
download | barebox-bc01035f223d08929459518de3e0ea52be2c961c.tar.gz barebox-bc01035f223d08929459518de3e0ea52be2c961c.tar.xz |
Merge branch 'for-next/w1' into for-next/at91
Diffstat (limited to 'common')
-rw-r--r-- | common/clock.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/common/clock.c b/common/clock.c index 8adbeaff3e..9c7c1ba58c 100644 --- a/common/clock.c +++ b/common/clock.c @@ -135,23 +135,29 @@ uint32_t clocksource_hz2mult(uint32_t hz, uint32_t shift_constant) return (uint32_t)tmp; } -int is_timeout(uint64_t start_ns, uint64_t time_offset_ns) +int is_timeout_non_interruptible(uint64_t start_ns, uint64_t time_offset_ns) { - if (time_offset_ns >= 100 * USECOND) - poller_call(); - if ((int64_t)(start_ns + time_offset_ns - get_time_ns()) < 0) return 1; else return 0; } +EXPORT_SYMBOL(is_timeout_non_interruptible); + +int is_timeout(uint64_t start_ns, uint64_t time_offset_ns) +{ + if (time_offset_ns >= 100 * USECOND) + poller_call(); + + return is_timeout_non_interruptible(start_ns, time_offset_ns); +} EXPORT_SYMBOL(is_timeout); void ndelay(unsigned long nsecs) { uint64_t start = get_time_ns(); - while(!is_timeout(start, nsecs)); + while(!is_timeout_non_interruptible(start, nsecs)); } EXPORT_SYMBOL(ndelay); |