diff options
-rw-r--r-- | common/clock.c | 8 | ||||
-rw-r--r-- | include/clock.h | 1 |
2 files changed, 9 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(); diff --git a/include/clock.h b/include/clock.h index 85ce40182f..54b895e318 100644 --- a/include/clock.h +++ b/include/clock.h @@ -27,6 +27,7 @@ int is_timeout(uint64_t start_ns, uint64_t time_offset_ns); // void udelay(unsigned long usecs); +void ndelay(unsigned long nsecs); void mdelay(unsigned long msecs); #define SECOND ((uint64_t)(1000 * 1000 * 1000)) |