Commit 5fd861b682785f650114f4df53060d1be7fedecd
Committed by
Linus Torvalds
1 parent
7d37c6d52f
Exists in
master
and in
7 other branches
[PATCH] uml: s390 preparation, delay moved to arch
s390 has fast read access to realtime clock (nanosecond resolution). So it makes sense to have an arch-specific implementation not only of __delay, but __udelay also. Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 6 changed files with 43 additions and 21 deletions Side-by-side Diff
arch/um/kernel/ksyms.c
... | ... | @@ -10,7 +10,6 @@ |
10 | 10 | #include "linux/spinlock.h" |
11 | 11 | #include "linux/highmem.h" |
12 | 12 | #include "asm/current.h" |
13 | -#include "asm/delay.h" | |
14 | 13 | #include "asm/processor.h" |
15 | 14 | #include "asm/unistd.h" |
16 | 15 | #include "asm/pgalloc.h" |
... | ... | @@ -28,8 +27,6 @@ |
28 | 27 | EXPORT_SYMBOL(set_signals); |
29 | 28 | EXPORT_SYMBOL(get_signals); |
30 | 29 | EXPORT_SYMBOL(kernel_thread); |
31 | -EXPORT_SYMBOL(__const_udelay); | |
32 | -EXPORT_SYMBOL(__udelay); | |
33 | 30 | EXPORT_SYMBOL(sys_waitpid); |
34 | 31 | EXPORT_SYMBOL(task_size); |
35 | 32 | EXPORT_SYMBOL(flush_tlb_range); |
arch/um/kernel/time_kern.c
... | ... | @@ -48,8 +48,6 @@ |
48 | 48 | static long long delta; /* Deviation per interval */ |
49 | 49 | #endif |
50 | 50 | |
51 | -#define MILLION 1000000 | |
52 | - | |
53 | 51 | void timer_irq(union uml_pt_regs *regs) |
54 | 52 | { |
55 | 53 | unsigned long long ticks = 0; |
... | ... | @@ -134,22 +132,6 @@ |
134 | 132 | new.tv_nsec = 0; |
135 | 133 | do_settimeofday(&new); |
136 | 134 | return 0; |
137 | -} | |
138 | - | |
139 | -void __udelay(unsigned long usecs) | |
140 | -{ | |
141 | - int i, n; | |
142 | - | |
143 | - n = (loops_per_jiffy * HZ * usecs) / MILLION; | |
144 | - for(i=0;i<n;i++) ; | |
145 | -} | |
146 | - | |
147 | -void __const_udelay(unsigned long usecs) | |
148 | -{ | |
149 | - int i, n; | |
150 | - | |
151 | - n = (loops_per_jiffy * HZ * usecs) / MILLION; | |
152 | - for(i=0;i<n;i++) ; | |
153 | 135 | } |
154 | 136 | |
155 | 137 | void timer_handler(int sig, union uml_pt_regs *regs) |
arch/um/sys-i386/delay.c
1 | +#include "linux/delay.h" | |
2 | +#include "asm/param.h" | |
3 | + | |
1 | 4 | void __delay(unsigned long time) |
2 | 5 | { |
3 | 6 | /* Stolen from the i386 __loop_delay */ |
... | ... | @@ -10,5 +13,21 @@ |
10 | 13 | "2:\tdecl %0\n\tjns 2b" |
11 | 14 | :"=&a" (d0) |
12 | 15 | :"0" (time)); |
16 | +} | |
17 | + | |
18 | +void __udelay(unsigned long usecs) | |
19 | +{ | |
20 | + int i, n; | |
21 | + | |
22 | + n = (loops_per_jiffy * HZ * usecs) / MILLION; | |
23 | + for(i=0;i<n;i++) ; | |
24 | +} | |
25 | + | |
26 | +void __const_udelay(unsigned long usecs) | |
27 | +{ | |
28 | + int i, n; | |
29 | + | |
30 | + n = (loops_per_jiffy * HZ * usecs) / MILLION; | |
31 | + for(i=0;i<n;i++) ; | |
13 | 32 | } |
arch/um/sys-i386/ksyms.c
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | #include "linux/in6.h" |
3 | 3 | #include "linux/rwsem.h" |
4 | 4 | #include "asm/byteorder.h" |
5 | +#include "asm/delay.h" | |
5 | 6 | #include "asm/semaphore.h" |
6 | 7 | #include "asm/uaccess.h" |
7 | 8 | #include "asm/checksum.h" |
... | ... | @@ -14,4 +15,8 @@ |
14 | 15 | |
15 | 16 | /* Networking helper routines. */ |
16 | 17 | EXPORT_SYMBOL(csum_partial); |
18 | + | |
19 | +/* delay core functions */ | |
20 | +EXPORT_SYMBOL(__const_udelay); | |
21 | +EXPORT_SYMBOL(__udelay); |
arch/um/sys-x86_64/delay.c
... | ... | @@ -5,13 +5,31 @@ |
5 | 5 | * Licensed under the GPL |
6 | 6 | */ |
7 | 7 | |
8 | +#include "linux/delay.h" | |
8 | 9 | #include "asm/processor.h" |
10 | +#include "asm/param.h" | |
9 | 11 | |
10 | 12 | void __delay(unsigned long loops) |
11 | 13 | { |
12 | 14 | unsigned long i; |
13 | 15 | |
14 | 16 | for(i = 0; i < loops; i++) ; |
17 | +} | |
18 | + | |
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++) ; | |
15 | 33 | } |
16 | 34 | |
17 | 35 | /* |