aboutsummaryrefslogtreecommitdiff
path: root/arch/s390/lib/delay.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2011-05-26 09:48:28 +0200
committerHeiko Carstens <heiko.carstens@de.ibm.com>2011-05-26 09:48:25 +0200
commitb396637841fff79e9520514e8dcbe769c20a2ea0 (patch)
treeb268ca9d099e8e7514ed72e6035c08df0fd9f8e4 /arch/s390/lib/delay.c
parentac5fa22fd4f27376e4ec41b44279c9992322d7ce (diff)
[S390] delay: implement ndelay
Implement ndelay() on s390 as well. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/lib/delay.c')
-rw-r--r--arch/s390/lib/delay.c15
1 files changed, 15 insertions, 0 deletions
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 <linux/module.h>
#include <linux/irqflags.h>
#include <linux/interrupt.h>
+#include <asm/div64.h>
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);