Lines Matching full:clocksource
2 /* linux/include/linux/clocksource.h
6 * If you are not a clocksource, or timekeeping code, you should
24 struct clocksource;
29 #include <asm/clocksource.h>
32 #include <vdso/clocksource.h>
35 * struct clocksource - hardware abstraction for a free running counter
39 * @read: Returns a cycle value, passes clocksource as argument
44 * @max_idle_ns: Maximum idle time permitted by the clocksource (nsecs)
51 * @name: Pointer to clocksource name
56 * to assign your clocksource a rating
62 * A correct and usable clocksource.
64 * A reasonably fast and accurate clocksource.
66 * The ideal clocksource. A must-use where
70 * validate the clocksource from which the snapshot was
73 * @enable: Optional function to enable the clocksource
74 * @disable: Optional function to disable the clocksource
75 * @suspend: Optional suspend function for the clocksource
76 * @resume: Optional resume function for the clocksource
77 * @mark_unstable: Optional function to inform the clocksource driver that
78 * the watchdog marked the clocksource unstable
82 * @cs_last: Last clocksource value for clocksource watchdog
84 * @owner: Module reference, must be set by clocksource in modules
90 * The pointer to the clocksource itself is handed to the read
92 * clocksource into your own struct. Depending on the amount of
96 struct clocksource { struct
97 u64 (*read)(struct clocksource *cs); argument
115 int (*enable)(struct clocksource *cs); argument
116 void (*disable)(struct clocksource *cs); argument
117 void (*suspend)(struct clocksource *cs); argument
118 void (*resume)(struct clocksource *cs); argument
119 void (*mark_unstable)(struct clocksource *cs); argument
120 void (*tick_stable)(struct clocksource *cs); argument
166 * @khz: Clocksource frequency in KHz
167 * @shift_constant: Clocksource shift factor
170 * multiplier, given the clocksource shift value
179 * @hz: Clocksource frequency in Hz
180 * @shift_constant: Clocksource shift factor
184 * clocksource shift value
192 * clocksource_cyc2ns - converts clocksource cycles to nanoseconds
197 * Converts clocksource cycles to nanoseconds, using the given @mult and @shift.
199 * with absolute clocksource cycles (as those will easily overflow),
200 * but is only intended to be used with relative (delta) clocksource cycles.
210 extern int clocksource_unregister(struct clocksource*);
212 extern void clocksource_change_rating(struct clocksource *cs, int rating);
215 extern struct clocksource * __init clocksource_default_clock(void);
216 extern void clocksource_mark_unstable(struct clocksource *cs);
218 clocksource_start_suspend_timing(struct clocksource *cs, u64 start_cycles);
219 extern u64 clocksource_stop_suspend_timing(struct clocksource *cs, u64 now);
231 __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
233 __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq);
236 * Don't call this unless you are a default clocksource
239 static inline int __clocksource_register(struct clocksource *cs) in __clocksource_register()
244 static inline int clocksource_register_hz(struct clocksource *cs, u32 hz) in clocksource_register_hz()
249 static inline int clocksource_register_khz(struct clocksource *cs, u32 khz) in clocksource_register_khz()
254 static inline void __clocksource_update_freq_hz(struct clocksource *cs, u32 hz) in __clocksource_update_freq_hz()
259 static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz) in __clocksource_update_freq_khz()
265 extern void clocksource_arch_init(struct clocksource *cs);
267 static inline void clocksource_arch_init(struct clocksource *cs) { } in clocksource_arch_init()
270 extern int timekeeping_notify(struct clocksource *clock);
272 extern u64 clocksource_mmio_readl_up(struct clocksource *);
273 extern u64 clocksource_mmio_readl_down(struct clocksource *);
274 extern u64 clocksource_mmio_readw_up(struct clocksource *);
275 extern u64 clocksource_mmio_readw_down(struct clocksource *);
278 unsigned long, int, unsigned, u64 (*)(struct clocksource *));
295 void clocksource_verify_percpu(struct clocksource *cs);