aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/clocksource.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r--include/linux/clocksource.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 83d2fbd81b93..4bca8b60cdf7 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -151,8 +151,10 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
151 * subtraction of non 64 bit counters 151 * subtraction of non 64 bit counters
152 * @mult: cycle to nanosecond multiplier 152 * @mult: cycle to nanosecond multiplier
153 * @shift: cycle to nanosecond divisor (power of two) 153 * @shift: cycle to nanosecond divisor (power of two)
154 * @max_idle_ns: max idle time permitted by the clocksource (nsecs)
154 * @flags: flags describing special properties 155 * @flags: flags describing special properties
155 * @vread: vsyscall based read 156 * @vread: vsyscall based read
157 * @suspend: suspend function for the clocksource, if necessary
156 * @resume: resume function for the clocksource, if necessary 158 * @resume: resume function for the clocksource, if necessary
157 */ 159 */
158struct clocksource { 160struct clocksource {
@@ -168,9 +170,11 @@ struct clocksource {
168 cycle_t mask; 170 cycle_t mask;
169 u32 mult; 171 u32 mult;
170 u32 shift; 172 u32 shift;
173 u64 max_idle_ns;
171 unsigned long flags; 174 unsigned long flags;
172 cycle_t (*vread)(void); 175 cycle_t (*vread)(void);
173 void (*resume)(void); 176 void (*suspend)(struct clocksource *cs);
177 void (*resume)(struct clocksource *cs);
174#ifdef CONFIG_IA64 178#ifdef CONFIG_IA64
175 void *fsys_mmio; /* used by fsyscall asm code */ 179 void *fsys_mmio; /* used by fsyscall asm code */
176#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) 180#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
@@ -275,15 +279,28 @@ extern void clocksource_unregister(struct clocksource*);
275extern void clocksource_touch_watchdog(void); 279extern void clocksource_touch_watchdog(void);
276extern struct clocksource* clocksource_get_next(void); 280extern struct clocksource* clocksource_get_next(void);
277extern void clocksource_change_rating(struct clocksource *cs, int rating); 281extern void clocksource_change_rating(struct clocksource *cs, int rating);
282extern void clocksource_suspend(void);
278extern void clocksource_resume(void); 283extern void clocksource_resume(void);
279extern struct clocksource * __init __weak clocksource_default_clock(void); 284extern struct clocksource * __init __weak clocksource_default_clock(void);
280extern void clocksource_mark_unstable(struct clocksource *cs); 285extern void clocksource_mark_unstable(struct clocksource *cs);
281 286
287extern void
288clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
289
290static inline void
291clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec)
292{
293 return clocks_calc_mult_shift(&cs->mult, &cs->shift, freq,
294 NSEC_PER_SEC, minsec);
295}
296
282#ifdef CONFIG_GENERIC_TIME_VSYSCALL 297#ifdef CONFIG_GENERIC_TIME_VSYSCALL
283extern void update_vsyscall(struct timespec *ts, struct clocksource *c); 298extern void
299update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult);
284extern void update_vsyscall_tz(void); 300extern void update_vsyscall_tz(void);
285#else 301#else
286static inline void update_vsyscall(struct timespec *ts, struct clocksource *c) 302static inline void
303update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult)
287{ 304{
288} 305}
289 306