diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-10-10 15:33:22 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-10-10 15:33:58 -0400 |
commit | 5a0d0e65379256b4da2c9092e197a2c761f51c01 (patch) | |
tree | 4dbac2b5498ad7ce1bd88d8bdfe6303169b9560c /arch/s390 | |
parent | b2300b9efe1b8174833e17f37e975c9da00c388a (diff) |
[S390] Move private simple udelay function to arch/s390/lib/delay.c.
Move cio's private simple udelay function to lib/delay.c and turn it
into something much more readable. So we have all implementations
at one place.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/delay.h | 1 | ||||
-rw-r--r-- | arch/s390/lib/delay.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/s390/include/asm/delay.h b/arch/s390/include/asm/delay.h index 78357314c450..a356c958e260 100644 --- a/arch/s390/include/asm/delay.h +++ b/arch/s390/include/asm/delay.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define _S390_DELAY_H | 15 | #define _S390_DELAY_H |
16 | 16 | ||
17 | extern void __udelay(unsigned long usecs); | 17 | extern void __udelay(unsigned long usecs); |
18 | extern void udelay_simple(unsigned long usecs); | ||
18 | extern void __delay(unsigned long loops); | 19 | extern void __delay(unsigned long loops); |
19 | 20 | ||
20 | #define udelay(n) __udelay(n) | 21 | #define udelay(n) __udelay(n) |
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c index 0953cee05efc..6ccb9fab055a 100644 --- a/arch/s390/lib/delay.c +++ b/arch/s390/lib/delay.c | |||
@@ -92,3 +92,16 @@ out: | |||
92 | local_irq_restore(flags); | 92 | local_irq_restore(flags); |
93 | preempt_enable(); | 93 | preempt_enable(); |
94 | } | 94 | } |
95 | |||
96 | /* | ||
97 | * Simple udelay variant. To be used on startup and reboot | ||
98 | * when the interrupt handler isn't working. | ||
99 | */ | ||
100 | void udelay_simple(unsigned long usecs) | ||
101 | { | ||
102 | u64 end; | ||
103 | |||
104 | end = get_clock() + ((u64) usecs << 12); | ||
105 | while (get_clock() < end) | ||
106 | cpu_relax(); | ||
107 | } | ||