diff options
author | Bodo Stroesser <bstroesser@fujitsu-siemens.com> | 2005-05-05 19:15:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-05 19:36:38 -0400 |
commit | 5fd861b682785f650114f4df53060d1be7fedecd (patch) | |
tree | eaa02425c2be79ac21ecc684a5b2a31d9f3320c2 /arch | |
parent | 7d37c6d52fce13008f20344790a81a6a5a0003b3 (diff) |
[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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/kernel/ksyms.c | 3 | ||||
-rw-r--r-- | arch/um/kernel/time_kern.c | 18 | ||||
-rw-r--r-- | arch/um/sys-i386/delay.c | 18 | ||||
-rw-r--r-- | arch/um/sys-i386/ksyms.c | 5 | ||||
-rw-r--r-- | arch/um/sys-x86_64/delay.c | 18 |
5 files changed, 41 insertions, 21 deletions
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c index b41d3397d07b..78d69dc74b26 100644 --- a/arch/um/kernel/ksyms.c +++ b/arch/um/kernel/ksyms.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include "linux/spinlock.h" | 10 | #include "linux/spinlock.h" |
11 | #include "linux/highmem.h" | 11 | #include "linux/highmem.h" |
12 | #include "asm/current.h" | 12 | #include "asm/current.h" |
13 | #include "asm/delay.h" | ||
14 | #include "asm/processor.h" | 13 | #include "asm/processor.h" |
15 | #include "asm/unistd.h" | 14 | #include "asm/unistd.h" |
16 | #include "asm/pgalloc.h" | 15 | #include "asm/pgalloc.h" |
@@ -28,8 +27,6 @@ EXPORT_SYMBOL(uml_physmem); | |||
28 | EXPORT_SYMBOL(set_signals); | 27 | EXPORT_SYMBOL(set_signals); |
29 | EXPORT_SYMBOL(get_signals); | 28 | EXPORT_SYMBOL(get_signals); |
30 | EXPORT_SYMBOL(kernel_thread); | 29 | EXPORT_SYMBOL(kernel_thread); |
31 | EXPORT_SYMBOL(__const_udelay); | ||
32 | EXPORT_SYMBOL(__udelay); | ||
33 | EXPORT_SYMBOL(sys_waitpid); | 30 | EXPORT_SYMBOL(sys_waitpid); |
34 | EXPORT_SYMBOL(task_size); | 31 | EXPORT_SYMBOL(task_size); |
35 | EXPORT_SYMBOL(flush_tlb_range); | 32 | EXPORT_SYMBOL(flush_tlb_range); |
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c index 2461cd73ca87..6516fc52afe0 100644 --- a/arch/um/kernel/time_kern.c +++ b/arch/um/kernel/time_kern.c | |||
@@ -48,8 +48,6 @@ static unsigned long long prev_usecs; | |||
48 | static long long delta; /* Deviation per interval */ | 48 | static long long delta; /* Deviation per interval */ |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #define MILLION 1000000 | ||
52 | |||
53 | void timer_irq(union uml_pt_regs *regs) | 51 | void timer_irq(union uml_pt_regs *regs) |
54 | { | 52 | { |
55 | unsigned long long ticks = 0; | 53 | unsigned long long ticks = 0; |
@@ -136,22 +134,6 @@ long um_stime(int __user *tptr) | |||
136 | return 0; | 134 | return 0; |
137 | } | 135 | } |
138 | 136 | ||
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 | } | ||
154 | |||
155 | void timer_handler(int sig, union uml_pt_regs *regs) | 137 | void timer_handler(int sig, union uml_pt_regs *regs) |
156 | { | 138 | { |
157 | local_irq_disable(); | 139 | local_irq_disable(); |
diff --git a/arch/um/sys-i386/delay.c b/arch/um/sys-i386/delay.c index 20d37dbbaf08..e9892eef51ce 100644 --- a/arch/um/sys-i386/delay.c +++ b/arch/um/sys-i386/delay.c | |||
@@ -1,3 +1,6 @@ | |||
1 | #include "linux/delay.h" | ||
2 | #include "asm/param.h" | ||
3 | |||
1 | void __delay(unsigned long time) | 4 | void __delay(unsigned long time) |
2 | { | 5 | { |
3 | /* Stolen from the i386 __loop_delay */ | 6 | /* Stolen from the i386 __loop_delay */ |
@@ -12,3 +15,18 @@ void __delay(unsigned long time) | |||
12 | :"0" (time)); | 15 | :"0" (time)); |
13 | } | 16 | } |
14 | 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++) ; | ||
32 | } | ||
diff --git a/arch/um/sys-i386/ksyms.c b/arch/um/sys-i386/ksyms.c index b10bfdd26cd6..db524ab3f743 100644 --- a/arch/um/sys-i386/ksyms.c +++ b/arch/um/sys-i386/ksyms.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include "linux/in6.h" | 2 | #include "linux/in6.h" |
3 | #include "linux/rwsem.h" | 3 | #include "linux/rwsem.h" |
4 | #include "asm/byteorder.h" | 4 | #include "asm/byteorder.h" |
5 | #include "asm/delay.h" | ||
5 | #include "asm/semaphore.h" | 6 | #include "asm/semaphore.h" |
6 | #include "asm/uaccess.h" | 7 | #include "asm/uaccess.h" |
7 | #include "asm/checksum.h" | 8 | #include "asm/checksum.h" |
@@ -14,3 +15,7 @@ EXPORT_SYMBOL(__up_wakeup); | |||
14 | 15 | ||
15 | /* Networking helper routines. */ | 16 | /* Networking helper routines. */ |
16 | EXPORT_SYMBOL(csum_partial); | 17 | EXPORT_SYMBOL(csum_partial); |
18 | |||
19 | /* delay core functions */ | ||
20 | EXPORT_SYMBOL(__const_udelay); | ||
21 | EXPORT_SYMBOL(__udelay); | ||
diff --git a/arch/um/sys-x86_64/delay.c b/arch/um/sys-x86_64/delay.c index f3b5187942b4..651332aeec22 100644 --- a/arch/um/sys-x86_64/delay.c +++ b/arch/um/sys-x86_64/delay.c | |||
@@ -5,7 +5,9 @@ | |||
5 | * Licensed under the GPL | 5 | * Licensed under the GPL |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "linux/delay.h" | ||
8 | #include "asm/processor.h" | 9 | #include "asm/processor.h" |
10 | #include "asm/param.h" | ||
9 | 11 | ||
10 | void __delay(unsigned long loops) | 12 | void __delay(unsigned long loops) |
11 | { | 13 | { |
@@ -14,6 +16,22 @@ void __delay(unsigned long loops) | |||
14 | for(i = 0; i < loops; i++) ; | 16 | for(i = 0; i < loops; i++) ; |
15 | } | 17 | } |
16 | 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++) ; | ||
33 | } | ||
34 | |||
17 | /* | 35 | /* |
18 | * Overrides for Emacs so that we follow Linus's tabbing style. | 36 | * Overrides for Emacs so that we follow Linus's tabbing style. |
19 | * Emacs will notice this stuff at the end of the file and automatically | 37 | * Emacs will notice this stuff at the end of the file and automatically |