Commit 941e492b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

read_current_timer() cleanups

- All implementations can be __devinit

- The function prototypes were in asm/timex.h but they all must be the same,
  so create a single declaration in linux/timex.h.

- uninline the sparc64 version to match the other architectures

- Don't bother #defining ARCH_HAS_READ_CURRENT_TIMER to a particular value.

[ezk@cs.sunysb.edu: fix build]
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 83bad1d7
...@@ -12,13 +12,15 @@ ...@@ -12,13 +12,15 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/timex.h>
#include <linux/param.h> #include <linux/param.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/init.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/sysreg.h> #include <asm/sysreg.h>
int read_current_timer(unsigned long *timer_value) int __devinit read_current_timer(unsigned long *timer_value)
{ {
*timer_value = sysreg_read(COUNT); *timer_value = sysreg_read(COUNT);
return 0; return 0;
......
...@@ -1707,6 +1707,11 @@ static void __exit rtc_mini_exit(void) ...@@ -1707,6 +1707,11 @@ static void __exit rtc_mini_exit(void)
misc_deregister(&rtc_mini_dev); misc_deregister(&rtc_mini_dev);
} }
int __devinit read_current_timer(unsigned long *timer_val)
{
*timer_val = tick_ops->get_tick();
return 0;
}
module_init(rtc_mini_init); module_init(rtc_mini_init);
module_exit(rtc_mini_exit); module_exit(rtc_mini_exit);
...@@ -12,8 +12,10 @@ ...@@ -12,8 +12,10 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/timex.h>
#include <linux/preempt.h> #include <linux/preempt.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/delay.h> #include <asm/delay.h>
...@@ -63,7 +65,7 @@ void use_tsc_delay(void) ...@@ -63,7 +65,7 @@ void use_tsc_delay(void)
delay_fn = delay_tsc; delay_fn = delay_tsc;
} }
int read_current_timer(unsigned long *timer_val) int __devinit read_current_timer(unsigned long *timer_val)
{ {
if (delay_fn == delay_tsc) { if (delay_fn == delay_tsc) {
rdtscl(*timer_val); rdtscl(*timer_val);
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/timex.h>
#include <linux/preempt.h> #include <linux/preempt.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h>
#include <asm/delay.h> #include <asm/delay.h>
#include <asm/msr.h> #include <asm/msr.h>
...@@ -20,7 +22,7 @@ ...@@ -20,7 +22,7 @@
#include <asm/smp.h> #include <asm/smp.h>
#endif #endif
int read_current_timer(unsigned long *timer_value) int __devinit read_current_timer(unsigned long *timer_value)
{ {
rdtscll(*timer_value); rdtscll(*timer_value);
return 0; return 0;
......
...@@ -34,7 +34,6 @@ static inline cycles_t get_cycles (void) ...@@ -34,7 +34,6 @@ static inline cycles_t get_cycles (void)
return 0; return 0;
} }
extern int read_current_timer(unsigned long *timer_value); #define ARCH_HAS_READ_CURRENT_TIMER
#define ARCH_HAS_READ_CURRENT_TIMER 1
#endif /* __ASM_AVR32_TIMEX_H */ #endif /* __ASM_AVR32_TIMEX_H */
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
typedef unsigned long cycles_t; typedef unsigned long cycles_t;
#define get_cycles() tick_ops->get_tick() #define get_cycles() tick_ops->get_tick()
#define ARCH_HAS_READ_CURRENT_TIMER 1 #define ARCH_HAS_READ_CURRENT_TIMER
#define read_current_timer(timer_val_p) \
({ *timer_val_p = tick_ops->get_tick(); \
0; \
})
#endif #endif
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#endif #endif
#define CLOCK_TICK_RATE PIT_TICK_RATE #define CLOCK_TICK_RATE PIT_TICK_RATE
extern int read_current_timer(unsigned long *timer_value); #define ARCH_HAS_READ_CURRENT_TIMER
#define ARCH_HAS_READ_CURRENT_TIMER 1
#endif #endif
...@@ -244,6 +244,8 @@ extern int do_adjtimex(struct timex *); ...@@ -244,6 +244,8 @@ extern int do_adjtimex(struct timex *);
/* Don't use! Compatibility define for existing users. */ /* Don't use! Compatibility define for existing users. */
#define tickadj (500/HZ ? : 1) #define tickadj (500/HZ ? : 1)
int read_current_timer(unsigned long *timer_val);
#endif /* KERNEL */ #endif /* KERNEL */
#endif /* LINUX_TIMEX_H */ #endif /* LINUX_TIMEX_H */
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/timex.h>
#include <asm/timex.h>
unsigned long preset_lpj; unsigned long preset_lpj;
static int __init lpj_setup(char *str) static int __init lpj_setup(char *str)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment