Lines Matching full:clocksource
2 /* linux/include/linux/clocksource.h
6 * If you are not a clocksource, or timekeeping code, you should
25 struct clocksource;
30 #include <asm/clocksource.h>
33 #include <vdso/clocksource.h>
36 * struct clocksource - hardware abstraction for a free running counter
40 * @read: Returns a cycle value, passes clocksource as argument
45 * @max_idle_ns: Maximum idle time permitted by the clocksource (nsecs)
53 * @name: Pointer to clocksource name
55 * @freq_khz: Clocksource frequency in khz.
59 * to assign your clocksource a rating
65 * A correct and usable clocksource.
67 * A reasonably fast and accurate clocksource.
69 * The ideal clocksource. A must-use where
73 * validate the clocksource from which the snapshot was
76 * @base: Hardware abstraction for clock on which a clocksource
78 * @enable: Optional function to enable the clocksource
79 * @disable: Optional function to disable the clocksource
80 * @suspend: Optional suspend function for the clocksource
81 * @resume: Optional resume function for the clocksource
82 * @mark_unstable: Optional function to inform the clocksource driver that
83 * the watchdog marked the clocksource unstable
87 * @cs_last: Last clocksource value for clocksource watchdog
89 * @owner: Module reference, must be set by clocksource in modules
95 * The pointer to the clocksource itself is handed to the read
97 * clocksource into your own struct. Depending on the amount of
101 struct clocksource { struct
102 u64 (*read)(struct clocksource *cs); argument
123 int (*enable)(struct clocksource *cs); argument
124 void (*disable)(struct clocksource *cs); argument
125 void (*suspend)(struct clocksource *cs); argument
126 void (*resume)(struct clocksource *cs); argument
127 void (*mark_unstable)(struct clocksource *cs); argument
128 void (*tick_stable)(struct clocksource *cs); argument
174 * @khz: Clocksource frequency in KHz
175 * @shift_constant: Clocksource shift factor
178 * multiplier, given the clocksource shift value
187 * @hz: Clocksource frequency in Hz
188 * @shift_constant: Clocksource shift factor
192 * clocksource shift value
200 * clocksource_cyc2ns - converts clocksource cycles to nanoseconds
205 * Converts clocksource cycles to nanoseconds, using the given @mult and @shift.
207 * with absolute clocksource cycles (as those will easily overflow),
208 * but is only intended to be used with relative (delta) clocksource cycles.
218 extern int clocksource_unregister(struct clocksource*);
222 extern struct clocksource * __init clocksource_default_clock(void);
223 extern void clocksource_mark_unstable(struct clocksource *cs);
225 clocksource_start_suspend_timing(struct clocksource *cs, u64 start_cycles);
226 extern u64 clocksource_stop_suspend_timing(struct clocksource *cs, u64 now);
238 __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
240 __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq);
243 * Don't call this unless you are a default clocksource
246 static inline int __clocksource_register(struct clocksource *cs) in __clocksource_register()
251 static inline int clocksource_register_hz(struct clocksource *cs, u32 hz) in clocksource_register_hz()
256 static inline int clocksource_register_khz(struct clocksource *cs, u32 khz) in clocksource_register_khz()
261 static inline void __clocksource_update_freq_hz(struct clocksource *cs, u32 hz) in __clocksource_update_freq_hz()
266 static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz) in __clocksource_update_freq_khz()
272 extern void clocksource_arch_init(struct clocksource *cs);
274 static inline void clocksource_arch_init(struct clocksource *cs) { } in clocksource_arch_init()
277 extern int timekeeping_notify(struct clocksource *clock);
279 extern u64 clocksource_mmio_readl_up(struct clocksource *);
280 extern u64 clocksource_mmio_readl_down(struct clocksource *);
281 extern u64 clocksource_mmio_readw_up(struct clocksource *);
282 extern u64 clocksource_mmio_readw_down(struct clocksource *);
285 unsigned long, int, unsigned, u64 (*)(struct clocksource *));
305 * can be random big latencies during the clocksource/watchdog in clocksource_get_max_watchdog_retry()
314 void clocksource_verify_percpu(struct clocksource *cs);
317 * struct clocksource_base - hardware abstraction for clock on which a clocksource
320 * functions which require that the current clocksource is based
322 * functions to allow callers to validate the clocksource from
325 * @offset: Offset between the base clock and the clocksource
326 * @numerator: Numerator of the clock ratio between base clock and the clocksource
327 * @denominator: Denominator of the clock ratio between base clock and the clocksource