Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252218
b: refs/heads/master
c: b396637
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Carstens committed May 26, 2011
1 parent 2b3b5ab commit 4e0031f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac5fa22fd4f27376e4ec41b44279c9992322d7ce
refs/heads/master: b396637841fff79e9520514e8dcbe769c20a2ea0
8 changes: 5 additions & 3 deletions trunk/arch/s390/include/asm/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
#ifndef _S390_DELAY_H
#define _S390_DELAY_H

extern void __udelay(unsigned long long usecs);
extern void udelay_simple(unsigned long long usecs);
extern void __delay(unsigned long loops);
void __ndelay(unsigned long long nsecs);
void __udelay(unsigned long long usecs);
void udelay_simple(unsigned long long usecs);
void __delay(unsigned long loops);

#define ndelay(n) __ndelay((unsigned long long) (n))
#define udelay(n) __udelay((unsigned long long) (n))
#define mdelay(n) __udelay((unsigned long long) (n) * 1000)

Expand Down
15 changes: 15 additions & 0 deletions trunk/arch/s390/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);

0 comments on commit 4e0031f

Please sign in to comment.