aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/tick-internal.h')
-rw-r--r--kernel/time/tick-internal.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
new file mode 100644
index 000000000000..9272f446b21c
--- /dev/null
+++ b/kernel/time/tick-internal.h
@@ -0,0 +1,65 @@
1/*
2 * tick internal variable and functions used by low/high res code
3 */
4DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
5extern spinlock_t tick_device_lock;
6extern ktime_t tick_next_period;
7extern ktime_t tick_period;
8
9extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast);
10extern void tick_handle_periodic(struct clock_event_device *dev);
11
12/*
13 * Broadcasting support
14 */
15#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
16extern int tick_do_broadcast(cpumask_t mask);
17extern struct tick_device tick_broadcast_device;
18extern spinlock_t tick_broadcast_lock;
19
20extern int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu);
21extern int tick_check_broadcast_device(struct clock_event_device *dev);
22extern int tick_is_broadcast_device(struct clock_event_device *dev);
23extern void tick_broadcast_on_off(unsigned long reason, int *oncpu);
24extern void tick_shutdown_broadcast(unsigned int *cpup);
25
26extern void
27tick_set_periodic_handler(struct clock_event_device *dev, int broadcast);
28
29#else /* !BROADCAST */
30
31static inline int tick_check_broadcast_device(struct clock_event_device *dev)
32{
33 return 0;
34}
35
36static inline int tick_is_broadcast_device(struct clock_event_device *dev)
37{
38 return 0;
39}
40static inline int tick_device_uses_broadcast(struct clock_event_device *dev,
41 int cpu)
42{
43 return 0;
44}
45static inline void tick_do_periodic_broadcast(struct clock_event_device *d) { }
46static inline void tick_broadcast_on_off(unsigned long reason, int *oncpu) { }
47static inline void tick_shutdown_broadcast(unsigned int *cpup) { }
48
49/*
50 * Set the periodic handler in non broadcast mode
51 */
52static inline void tick_set_periodic_handler(struct clock_event_device *dev,
53 int broadcast)
54{
55 dev->event_handler = tick_handle_periodic;
56}
57#endif /* !BROADCAST */
58
59/*
60 * Check, if the device is functional or a dummy for broadcast
61 */
62static inline int tick_device_is_functional(struct clock_event_device *dev)
63{
64 return !(dev->features & CLOCK_EVT_FEAT_DUMMY);
65}