diff options
Diffstat (limited to 'include/linux/clocksource.h')
| -rw-r--r-- | include/linux/clocksource.h | 23 |
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 | */ |
| 158 | struct clocksource { | 160 | struct 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*); | |||
| 275 | extern void clocksource_touch_watchdog(void); | 279 | extern void clocksource_touch_watchdog(void); |
| 276 | extern struct clocksource* clocksource_get_next(void); | 280 | extern struct clocksource* clocksource_get_next(void); |
| 277 | extern void clocksource_change_rating(struct clocksource *cs, int rating); | 281 | extern void clocksource_change_rating(struct clocksource *cs, int rating); |
| 282 | extern void clocksource_suspend(void); | ||
| 278 | extern void clocksource_resume(void); | 283 | extern void clocksource_resume(void); |
| 279 | extern struct clocksource * __init __weak clocksource_default_clock(void); | 284 | extern struct clocksource * __init __weak clocksource_default_clock(void); |
| 280 | extern void clocksource_mark_unstable(struct clocksource *cs); | 285 | extern void clocksource_mark_unstable(struct clocksource *cs); |
| 281 | 286 | ||
| 287 | extern void | ||
| 288 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); | ||
| 289 | |||
| 290 | static inline void | ||
| 291 | clocksource_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 |
| 283 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); | 298 | extern void |
| 299 | update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult); | ||
| 284 | extern void update_vsyscall_tz(void); | 300 | extern void update_vsyscall_tz(void); |
| 285 | #else | 301 | #else |
| 286 | static inline void update_vsyscall(struct timespec *ts, struct clocksource *c) | 302 | static inline void |
| 303 | update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult) | ||
| 287 | { | 304 | { |
| 288 | } | 305 | } |
| 289 | 306 | ||
