aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/avr32/lib/delay.c4
-rw-r--r--arch/sparc64/kernel/time.c5
-rw-r--r--arch/x86/lib/delay_32.c4
-rw-r--r--arch/x86/lib/delay_64.c4
-rw-r--r--include/asm-avr32/timex.h3
-rw-r--r--include/asm-sparc64/timex.h6
-rw-r--r--include/asm-x86/timex.h3
-rw-r--r--include/linux/timex.h2
-rw-r--r--init/calibrate.c3
9 files changed, 20 insertions, 14 deletions
diff --git a/arch/avr32/lib/delay.c b/arch/avr32/lib/delay.c
index b3bc0b56e2c6..9aa8800830f3 100644
--- a/arch/avr32/lib/delay.c
+++ b/arch/avr32/lib/delay.c
@@ -12,13 +12,15 @@
12 12
13#include <linux/delay.h> 13#include <linux/delay.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/timex.h>
15#include <linux/param.h> 16#include <linux/param.h>
16#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/init.h>
17 19
18#include <asm/processor.h> 20#include <asm/processor.h>
19#include <asm/sysreg.h> 21#include <asm/sysreg.h>
20 22
21int read_current_timer(unsigned long *timer_value) 23int __devinit read_current_timer(unsigned long *timer_value)
22{ 24{
23 *timer_value = sysreg_read(COUNT); 25 *timer_value = sysreg_read(COUNT);
24 return 0; 26 return 0;
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 4352ee4d8dac..d204f1ab1d4c 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -1707,6 +1707,11 @@ static void __exit rtc_mini_exit(void)
1707 misc_deregister(&rtc_mini_dev); 1707 misc_deregister(&rtc_mini_dev);
1708} 1708}
1709 1709
1710int __devinit read_current_timer(unsigned long *timer_val)
1711{
1712 *timer_val = tick_ops->get_tick();
1713 return 0;
1714}
1710 1715
1711module_init(rtc_mini_init); 1716module_init(rtc_mini_init);
1712module_exit(rtc_mini_exit); 1717module_exit(rtc_mini_exit);
diff --git a/arch/x86/lib/delay_32.c b/arch/x86/lib/delay_32.c
index aad9d95469dc..4535e6d147ad 100644
--- a/arch/x86/lib/delay_32.c
+++ b/arch/x86/lib/delay_32.c
@@ -12,8 +12,10 @@
12 12
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/timex.h>
15#include <linux/preempt.h> 16#include <linux/preempt.h>
16#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/init.h>
17 19
18#include <asm/processor.h> 20#include <asm/processor.h>
19#include <asm/delay.h> 21#include <asm/delay.h>
@@ -63,7 +65,7 @@ void use_tsc_delay(void)
63 delay_fn = delay_tsc; 65 delay_fn = delay_tsc;
64} 66}
65 67
66int read_current_timer(unsigned long *timer_val) 68int __devinit read_current_timer(unsigned long *timer_val)
67{ 69{
68 if (delay_fn == delay_tsc) { 70 if (delay_fn == delay_tsc) {
69 rdtscl(*timer_val); 71 rdtscl(*timer_val);
diff --git a/arch/x86/lib/delay_64.c b/arch/x86/lib/delay_64.c
index 45cdd3fbd91c..bbc610518516 100644
--- a/arch/x86/lib/delay_64.c
+++ b/arch/x86/lib/delay_64.c
@@ -10,8 +10,10 @@
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/timex.h>
13#include <linux/preempt.h> 14#include <linux/preempt.h>
14#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/init.h>
15 17
16#include <asm/delay.h> 18#include <asm/delay.h>
17#include <asm/msr.h> 19#include <asm/msr.h>
@@ -20,7 +22,7 @@
20#include <asm/smp.h> 22#include <asm/smp.h>
21#endif 23#endif
22 24
23int read_current_timer(unsigned long *timer_value) 25int __devinit read_current_timer(unsigned long *timer_value)
24{ 26{
25 rdtscll(*timer_value); 27 rdtscll(*timer_value);
26 return 0; 28 return 0;
diff --git a/include/asm-avr32/timex.h b/include/asm-avr32/timex.h
index 5e44ecb3ce0c..187dcf38b210 100644
--- a/include/asm-avr32/timex.h
+++ b/include/asm-avr32/timex.h
@@ -34,7 +34,6 @@ static inline cycles_t get_cycles (void)
34 return 0; 34 return 0;
35} 35}
36 36
37extern int read_current_timer(unsigned long *timer_value); 37#define ARCH_HAS_READ_CURRENT_TIMER
38#define ARCH_HAS_READ_CURRENT_TIMER 1
39 38
40#endif /* __ASM_AVR32_TIMEX_H */ 39#endif /* __ASM_AVR32_TIMEX_H */
diff --git a/include/asm-sparc64/timex.h b/include/asm-sparc64/timex.h
index 2a5e4ebaad80..c622535c4560 100644
--- a/include/asm-sparc64/timex.h
+++ b/include/asm-sparc64/timex.h
@@ -14,10 +14,6 @@
14typedef unsigned long cycles_t; 14typedef unsigned long cycles_t;
15#define get_cycles() tick_ops->get_tick() 15#define get_cycles() tick_ops->get_tick()
16 16
17#define ARCH_HAS_READ_CURRENT_TIMER 1 17#define ARCH_HAS_READ_CURRENT_TIMER
18#define read_current_timer(timer_val_p) \
19({ *timer_val_p = tick_ops->get_tick(); \
20 0; \
21})
22 18
23#endif 19#endif
diff --git a/include/asm-x86/timex.h b/include/asm-x86/timex.h
index 27cfd6c599ba..43e5a78500c5 100644
--- a/include/asm-x86/timex.h
+++ b/include/asm-x86/timex.h
@@ -14,7 +14,6 @@
14#endif 14#endif
15#define CLOCK_TICK_RATE PIT_TICK_RATE 15#define CLOCK_TICK_RATE PIT_TICK_RATE
16 16
17extern int read_current_timer(unsigned long *timer_value); 17#define ARCH_HAS_READ_CURRENT_TIMER
18#define ARCH_HAS_READ_CURRENT_TIMER 1
19 18
20#endif 19#endif
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 24c6a2b59511..8ea3e71ba7fa 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -244,6 +244,8 @@ extern int do_adjtimex(struct timex *);
244/* Don't use! Compatibility define for existing users. */ 244/* Don't use! Compatibility define for existing users. */
245#define tickadj (500/HZ ? : 1) 245#define tickadj (500/HZ ? : 1)
246 246
247int read_current_timer(unsigned long *timer_val);
248
247#endif /* KERNEL */ 249#endif /* KERNEL */
248 250
249#endif /* LINUX_TIMEX_H */ 251#endif /* LINUX_TIMEX_H */
diff --git a/init/calibrate.c b/init/calibrate.c
index 2d3d73bd4ce1..1d87891b6fcd 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -7,8 +7,7 @@
7#include <linux/jiffies.h> 7#include <linux/jiffies.h>
8#include <linux/delay.h> 8#include <linux/delay.h>
9#include <linux/init.h> 9#include <linux/init.h>
10 10#include <linux/timex.h>
11#include <asm/timex.h>
12 11
13unsigned long preset_lpj; 12unsigned long preset_lpj;
14static int __init lpj_setup(char *str) 13static int __init lpj_setup(char *str)