Paul Mackerras | c55377e | 2005-11-14 17:22:01 +1100 | [diff] [blame] | 1 | #ifndef _ASM_POWERPC_DELAY_H |
| 2 | #define _ASM_POWERPC_DELAY_H |
Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 3 | #ifdef __KERNEL__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
| 5 | /* |
| 6 | * Copyright 1996, Paul Mackerras. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License |
| 10 | * as published by the Free Software Foundation; either version |
| 11 | * 2 of the License, or (at your option) any later version. |
| 12 | * |
| 13 | * PPC64 Support added by Dave Engebretsen, Todd Inglett, Mike Corrigan, |
| 14 | * Anton Blanchard. |
| 15 | */ |
| 16 | |
Paul Mackerras | 6defa38 | 2005-11-18 13:44:17 +1100 | [diff] [blame] | 17 | extern void __delay(unsigned long loops); |
| 18 | extern void udelay(unsigned long usecs); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
Anton Blanchard | 1e92a55 | 2006-06-15 14:11:22 +1000 | [diff] [blame] | 20 | /* |
| 21 | * On shared processor machines the generic implementation of mdelay can |
| 22 | * result in large errors. While each iteration of the loop inside mdelay |
| 23 | * is supposed to take 1ms, the hypervisor could sleep our partition for |
| 24 | * longer (eg 10ms). With the right timing these errors can add up. |
| 25 | * |
| 26 | * Since there is no 32bit overflow issue on 64bit kernels, just call |
| 27 | * udelay directly. |
| 28 | */ |
| 29 | #ifdef CONFIG_PPC64 |
| 30 | #define mdelay(n) udelay((n) * 1000) |
| 31 | #endif |
| 32 | |
Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 33 | #endif /* __KERNEL__ */ |
Paul Mackerras | c55377e | 2005-11-14 17:22:01 +1100 | [diff] [blame] | 34 | #endif /* _ASM_POWERPC_DELAY_H */ |