0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _ASM_TIME_H
0011 #define _ASM_TIME_H
0012
0013 #include <linux/rtc.h>
0014 #include <linux/spinlock.h>
0015 #include <linux/clockchips.h>
0016 #include <linux/clocksource.h>
0017
0018 extern spinlock_t rtc_lock;
0019
0020
0021
0022
0023 extern void plat_time_init(void);
0024
0025
0026
0027
0028
0029 extern unsigned int mips_hpt_frequency;
0030
0031
0032
0033
0034
0035 extern int (*perf_irq)(void);
0036 extern int __weak get_c0_perfcount_int(void);
0037
0038
0039
0040
0041 extern unsigned int get_c0_compare_int(void);
0042 extern int r4k_clockevent_init(void);
0043
0044 static inline int mips_clockevent_init(void)
0045 {
0046 #ifdef CONFIG_CEVT_R4K
0047 return r4k_clockevent_init();
0048 #else
0049 return -ENXIO;
0050 #endif
0051 }
0052
0053
0054
0055
0056 extern int init_r4k_clocksource(void);
0057
0058 static inline int init_mips_clocksource(void)
0059 {
0060 #ifdef CONFIG_CSRC_R4K
0061 return init_r4k_clocksource();
0062 #else
0063 return 0;
0064 #endif
0065 }
0066
0067 static inline void clockevent_set_clock(struct clock_event_device *cd,
0068 unsigned int clock)
0069 {
0070 clockevents_calc_mult_shift(cd, clock, 4);
0071 }
0072
0073 #endif