From b396637841fff79e9520514e8dcbe769c20a2ea0 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Thu, 26 May 2011 09:48:28 +0200 Subject: [S390] delay: implement ndelay Implement ndelay() on s390 as well. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/lib/delay.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arch/s390/lib/delay.c') diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c index 0f53110e1d0..a65229d91c9 100644 --- a/arch/s390/lib/delay.c +++ b/arch/s390/lib/delay.c @@ -12,6 +12,7 @@ #include #include #include +#include void __delay(unsigned long loops) { @@ -116,3 +117,17 @@ void udelay_simple(unsigned long long usecs) while (get_clock() < end) cpu_relax(); } + +void __ndelay(unsigned long long nsecs) +{ + u64 end; + + nsecs <<= 9; + do_div(nsecs, 125); + end = get_clock() + nsecs; + if (nsecs & ~0xfffUL) + __udelay(nsecs >> 12); + while (get_clock() < end) + barrier(); +} +EXPORT_SYMBOL(__ndelay); -- cgit v1.2.3-18-g5258