Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2003 PathScale, Inc. |
| 3 | * Copied from arch/x86_64 |
| 4 | * |
| 5 | * Licensed under the GPL |
| 6 | */ |
| 7 | |
Bodo Stroesser | 5fd861b | 2005-05-05 16:15:37 -0700 | [diff] [blame] | 8 | #include "linux/delay.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #include "asm/processor.h" |
Bodo Stroesser | 5fd861b | 2005-05-05 16:15:37 -0700 | [diff] [blame] | 10 | #include "asm/param.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
| 12 | void __delay(unsigned long loops) |
| 13 | { |
| 14 | unsigned long i; |
| 15 | |
| 16 | for(i = 0; i < loops; i++) ; |
| 17 | } |
| 18 | |
Bodo Stroesser | 5fd861b | 2005-05-05 16:15:37 -0700 | [diff] [blame] | 19 | void __udelay(unsigned long usecs) |
| 20 | { |
| 21 | int i, n; |
| 22 | |
| 23 | n = (loops_per_jiffy * HZ * usecs) / MILLION; |
| 24 | for(i=0;i<n;i++) ; |
| 25 | } |
| 26 | |
| 27 | void __const_udelay(unsigned long usecs) |
| 28 | { |
| 29 | int i, n; |
| 30 | |
| 31 | n = (loops_per_jiffy * HZ * usecs) / MILLION; |
| 32 | for(i=0;i<n;i++) ; |
| 33 | } |
| 34 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | /* |
| 36 | * Overrides for Emacs so that we follow Linus's tabbing style. |
| 37 | * Emacs will notice this stuff at the end of the file and automatically |
| 38 | * adjust the settings for this buffer only. This must remain at the end |
| 39 | * of the file. |
| 40 | * --------------------------------------------------------------------------- |
| 41 | * Local variables: |
| 42 | * c-file-style: "linux" |
| 43 | * End: |
| 44 | */ |