diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-11 09:52:39 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-13 16:41:22 +0200 |
commit | 4c01ac2e0e6f584feea933bd04ae2dfa82cfdbc4 (patch) | |
tree | e92068968f103d09e16c7dc797eea58ee6f3e0bd /common | |
parent | da4d33969e23589191dda3c4c7041a84ba42a583 (diff) | |
download | barebox-4c01ac2e0e6f584feea933bd04ae2dfa82cfdbc4.tar.gz barebox-4c01ac2e0e6f584feea933bd04ae2dfa82cfdbc4.tar.xz |
clocK: Add ndelay function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/clock.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/clock.c b/common/clock.c index e22b6a5409..ad708adbbf 100644 --- a/common/clock.c +++ b/common/clock.c @@ -92,6 +92,14 @@ int is_timeout(uint64_t start_ns, uint64_t time_offset_ns) } EXPORT_SYMBOL(is_timeout); +void ndelay(unsigned long nsecs) +{ + uint64_t start = get_time_ns(); + + while(!is_timeout(start, nsecs)); +} +EXPORT_SYMBOL(ndelay); + void udelay(unsigned long usecs) { uint64_t start = get_time_ns(); |