diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/clockchips.h | 19 | ||||
-rw-r--r-- | include/linux/clocksource.h | 12 | ||||
-rw-r--r-- | include/linux/tick.h | 5 | ||||
-rw-r--r-- | include/linux/time.h | 1 | ||||
-rw-r--r-- | include/linux/timex.h | 4 |
5 files changed, 31 insertions, 10 deletions
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 3a1dbba4d3a..0cf725bdd2a 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -77,10 +77,10 @@ enum clock_event_nofitiers { | |||
77 | struct clock_event_device { | 77 | struct clock_event_device { |
78 | const char *name; | 78 | const char *name; |
79 | unsigned int features; | 79 | unsigned int features; |
80 | unsigned long max_delta_ns; | 80 | u64 max_delta_ns; |
81 | unsigned long min_delta_ns; | 81 | u64 min_delta_ns; |
82 | unsigned long mult; | 82 | u32 mult; |
83 | int shift; | 83 | u32 shift; |
84 | int rating; | 84 | int rating; |
85 | int irq; | 85 | int irq; |
86 | const struct cpumask *cpumask; | 86 | const struct cpumask *cpumask; |
@@ -116,8 +116,8 @@ static inline unsigned long div_sc(unsigned long ticks, unsigned long nsec, | |||
116 | } | 116 | } |
117 | 117 | ||
118 | /* Clock event layer functions */ | 118 | /* Clock event layer functions */ |
119 | extern unsigned long clockevent_delta2ns(unsigned long latch, | 119 | extern u64 clockevent_delta2ns(unsigned long latch, |
120 | struct clock_event_device *evt); | 120 | struct clock_event_device *evt); |
121 | extern void clockevents_register_device(struct clock_event_device *dev); | 121 | extern void clockevents_register_device(struct clock_event_device *dev); |
122 | 122 | ||
123 | extern void clockevents_exchange_device(struct clock_event_device *old, | 123 | extern void clockevents_exchange_device(struct clock_event_device *old, |
@@ -130,6 +130,13 @@ extern int clockevents_program_event(struct clock_event_device *dev, | |||
130 | 130 | ||
131 | extern void clockevents_handle_noop(struct clock_event_device *dev); | 131 | extern void clockevents_handle_noop(struct clock_event_device *dev); |
132 | 132 | ||
133 | static inline void | ||
134 | clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec) | ||
135 | { | ||
136 | return clocks_calc_mult_shift(&ce->mult, &ce->shift, NSEC_PER_SEC, | ||
137 | freq, minsec); | ||
138 | } | ||
139 | |||
133 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 140 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
134 | extern void clockevents_notify(unsigned long reason, void *arg); | 141 | extern void clockevents_notify(unsigned long reason, void *arg); |
135 | #else | 142 | #else |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 83d2fbd81b9..279c5478e8a 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -151,6 +151,7 @@ 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 |
156 | * @resume: resume function for the clocksource, if necessary | 157 | * @resume: resume function for the clocksource, if necessary |
@@ -168,6 +169,7 @@ struct clocksource { | |||
168 | cycle_t mask; | 169 | cycle_t mask; |
169 | u32 mult; | 170 | u32 mult; |
170 | u32 shift; | 171 | u32 shift; |
172 | u64 max_idle_ns; | ||
171 | unsigned long flags; | 173 | unsigned long flags; |
172 | cycle_t (*vread)(void); | 174 | cycle_t (*vread)(void); |
173 | void (*resume)(void); | 175 | void (*resume)(void); |
@@ -279,6 +281,16 @@ extern void clocksource_resume(void); | |||
279 | extern struct clocksource * __init __weak clocksource_default_clock(void); | 281 | extern struct clocksource * __init __weak clocksource_default_clock(void); |
280 | extern void clocksource_mark_unstable(struct clocksource *cs); | 282 | extern void clocksource_mark_unstable(struct clocksource *cs); |
281 | 283 | ||
284 | extern void | ||
285 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); | ||
286 | |||
287 | static inline void | ||
288 | clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) | ||
289 | { | ||
290 | return clocks_calc_mult_shift(&cs->mult, &cs->shift, freq, | ||
291 | NSEC_PER_SEC, minsec); | ||
292 | } | ||
293 | |||
282 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL | 294 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL |
283 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); | 295 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); |
284 | extern void update_vsyscall_tz(void); | 296 | extern void update_vsyscall_tz(void); |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 0482229c07d..d2ae79e21be 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -43,6 +43,7 @@ enum tick_nohz_mode { | |||
43 | * @idle_exittime: Time when the idle state was left | 43 | * @idle_exittime: Time when the idle state was left |
44 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped | 44 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped |
45 | * @sleep_length: Duration of the current idle sleep | 45 | * @sleep_length: Duration of the current idle sleep |
46 | * @do_timer_lst: CPU was the last one doing do_timer before going idle | ||
46 | */ | 47 | */ |
47 | struct tick_sched { | 48 | struct tick_sched { |
48 | struct hrtimer sched_timer; | 49 | struct hrtimer sched_timer; |
@@ -64,6 +65,7 @@ struct tick_sched { | |||
64 | unsigned long last_jiffies; | 65 | unsigned long last_jiffies; |
65 | unsigned long next_jiffies; | 66 | unsigned long next_jiffies; |
66 | ktime_t idle_expires; | 67 | ktime_t idle_expires; |
68 | int do_timer_last; | ||
67 | }; | 69 | }; |
68 | 70 | ||
69 | extern void __init tick_init(void); | 71 | extern void __init tick_init(void); |
@@ -98,6 +100,9 @@ extern int tick_check_oneshot_change(int allow_nohz); | |||
98 | extern struct tick_sched *tick_get_tick_sched(int cpu); | 100 | extern struct tick_sched *tick_get_tick_sched(int cpu); |
99 | extern void tick_check_idle(int cpu); | 101 | extern void tick_check_idle(int cpu); |
100 | extern int tick_oneshot_mode_active(void); | 102 | extern int tick_oneshot_mode_active(void); |
103 | # ifndef arch_needs_cpu | ||
104 | # define arch_needs_cpu(cpu) (0) | ||
105 | # endif | ||
101 | # else | 106 | # else |
102 | static inline void tick_clock_notify(void) { } | 107 | static inline void tick_clock_notify(void) { } |
103 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 108 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
diff --git a/include/linux/time.h b/include/linux/time.h index fe04e5ef6a5..6e026e45a17 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -148,6 +148,7 @@ extern void monotonic_to_bootbased(struct timespec *ts); | |||
148 | 148 | ||
149 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 149 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
150 | extern int timekeeping_valid_for_hres(void); | 150 | extern int timekeeping_valid_for_hres(void); |
151 | extern u64 timekeeping_max_deferment(void); | ||
151 | extern void update_wall_time(void); | 152 | extern void update_wall_time(void); |
152 | extern void update_xtime_cache(u64 nsec); | 153 | extern void update_xtime_cache(u64 nsec); |
153 | extern void timekeeping_leap_insert(int leapsecond); | 154 | extern void timekeeping_leap_insert(int leapsecond); |
diff --git a/include/linux/timex.h b/include/linux/timex.h index e6967d10d9e..0c0ef7d4db7 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -261,11 +261,7 @@ static inline int ntp_synced(void) | |||
261 | 261 | ||
262 | #define NTP_SCALE_SHIFT 32 | 262 | #define NTP_SCALE_SHIFT 32 |
263 | 263 | ||
264 | #ifdef CONFIG_NO_HZ | ||
265 | #define NTP_INTERVAL_FREQ (2) | ||
266 | #else | ||
267 | #define NTP_INTERVAL_FREQ (HZ) | 264 | #define NTP_INTERVAL_FREQ (HZ) |
268 | #endif | ||
269 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) | 265 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) |
270 | 266 | ||
271 | /* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */ | 267 | /* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */ |