diff options
| author | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2006-09-29 02:45:43 -0400 |
|---|---|---|
| committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2006-09-29 02:45:43 -0400 |
| commit | 1b06e7926694178e146ff708b2c15a6da64c9765 (patch) | |
| tree | 30602fa4a854d6956f478212937726ca75ea13ce /arch/s390/lib/delay.c | |
| parent | 65e8697a12e356cd7a6ecafa1149f5c5c6a71593 (diff) | |
| parent | c972398b7871d9fb58c6a317786065a7cc6ca4be (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/s390/lib/delay.c')
| -rw-r--r-- | arch/s390/lib/delay.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c index 468f4ea33f99..027c4742a001 100644 --- a/arch/s390/lib/delay.c +++ b/arch/s390/lib/delay.c | |||
| @@ -27,9 +27,7 @@ void __delay(unsigned long loops) | |||
| 27 | * yield the megahertz number of the cpu. The important function | 27 | * yield the megahertz number of the cpu. The important function |
| 28 | * is udelay and that is done using the tod clock. -- martin. | 28 | * is udelay and that is done using the tod clock. -- martin. |
| 29 | */ | 29 | */ |
| 30 | __asm__ __volatile__( | 30 | asm volatile("0: brct %0,0b" : : "d" ((loops/2) + 1)); |
| 31 | "0: brct %0,0b" | ||
| 32 | : /* no outputs */ : "r" ((loops/2) + 1)); | ||
| 33 | } | 31 | } |
| 34 | 32 | ||
| 35 | /* | 33 | /* |
| @@ -38,13 +36,12 @@ void __delay(unsigned long loops) | |||
| 38 | */ | 36 | */ |
| 39 | void __udelay(unsigned long usecs) | 37 | void __udelay(unsigned long usecs) |
| 40 | { | 38 | { |
| 41 | uint64_t start_cc, end_cc; | 39 | uint64_t start_cc; |
| 42 | 40 | ||
| 43 | if (usecs == 0) | 41 | if (usecs == 0) |
| 44 | return; | 42 | return; |
| 45 | asm volatile ("STCK %0" : "=m" (start_cc)); | 43 | start_cc = get_clock(); |
| 46 | do { | 44 | do { |
| 47 | cpu_relax(); | 45 | cpu_relax(); |
| 48 | asm volatile ("STCK %0" : "=m" (end_cc)); | 46 | } while (((get_clock() - start_cc)/4096) < usecs); |
| 49 | } while (((end_cc - start_cc)/4096) < usecs); | ||
| 50 | } | 47 | } |
