From 4c01ac2e0e6f584feea933bd04ae2dfa82cfdbc4 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 11 Aug 2008 09:52:39 +0200 Subject: clocK: Add ndelay function Signed-off-by: Sascha Hauer --- common/clock.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common/clock.c') 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(); -- cgit v1.2.3