diff options
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r-- | include/linux/clocksource.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index daa4940cc0f1..bf297b03a4e4 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/timex.h> | 12 | #include <linux/timex.h> |
13 | #include <linux/time.h> | 13 | #include <linux/time.h> |
14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
15 | #include <linux/cache.h> | ||
15 | #include <linux/timer.h> | 16 | #include <linux/timer.h> |
16 | #include <asm/div64.h> | 17 | #include <asm/div64.h> |
17 | #include <asm/io.h> | 18 | #include <asm/io.h> |
@@ -48,10 +49,14 @@ struct clocksource; | |||
48 | * @shift: cycle to nanosecond divisor (power of two) | 49 | * @shift: cycle to nanosecond divisor (power of two) |
49 | * @flags: flags describing special properties | 50 | * @flags: flags describing special properties |
50 | * @vread: vsyscall based read | 51 | * @vread: vsyscall based read |
52 | * @resume: resume function for the clocksource, if necessary | ||
51 | * @cycle_interval: Used internally by timekeeping core, please ignore. | 53 | * @cycle_interval: Used internally by timekeeping core, please ignore. |
52 | * @xtime_interval: Used internally by timekeeping core, please ignore. | 54 | * @xtime_interval: Used internally by timekeeping core, please ignore. |
53 | */ | 55 | */ |
54 | struct clocksource { | 56 | struct clocksource { |
57 | /* | ||
58 | * First part of structure is read mostly | ||
59 | */ | ||
55 | char *name; | 60 | char *name; |
56 | struct list_head list; | 61 | struct list_head list; |
57 | int rating; | 62 | int rating; |
@@ -61,10 +66,18 @@ struct clocksource { | |||
61 | u32 shift; | 66 | u32 shift; |
62 | unsigned long flags; | 67 | unsigned long flags; |
63 | cycle_t (*vread)(void); | 68 | cycle_t (*vread)(void); |
69 | void (*resume)(void); | ||
64 | 70 | ||
65 | /* timekeeping specific data, ignore */ | 71 | /* timekeeping specific data, ignore */ |
66 | cycle_t cycle_last, cycle_interval; | 72 | cycle_t cycle_interval; |
67 | u64 xtime_nsec, xtime_interval; | 73 | u64 xtime_interval; |
74 | /* | ||
75 | * Second part is written at each timer interrupt | ||
76 | * Keep it in a different cache line to dirty no | ||
77 | * more than one cache line. | ||
78 | */ | ||
79 | cycle_t cycle_last ____cacheline_aligned_in_smp; | ||
80 | u64 xtime_nsec; | ||
68 | s64 error; | 81 | s64 error; |
69 | 82 | ||
70 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG | 83 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG |
@@ -198,6 +211,7 @@ static inline void clocksource_calculate_interval(struct clocksource *c, | |||
198 | extern int clocksource_register(struct clocksource*); | 211 | extern int clocksource_register(struct clocksource*); |
199 | extern struct clocksource* clocksource_get_next(void); | 212 | extern struct clocksource* clocksource_get_next(void); |
200 | extern void clocksource_change_rating(struct clocksource *cs, int rating); | 213 | extern void clocksource_change_rating(struct clocksource *cs, int rating); |
214 | extern void clocksource_resume(void); | ||
201 | 215 | ||
202 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL | 216 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL |
203 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); | 217 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); |