aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-internal.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2007-02-16 04:28:02 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-16 11:13:59 -0500
commitf8381cba04ba8173fd5a2b8e5cd8b3290ee13a98 (patch)
treead8c9f91ce031a04c62ff75fcd3237fc666f1c2e /kernel/time/tick-internal.h
parent906568c9c668ff994f4078932ec6ae1e3950d1af (diff)
[PATCH] tick-management: broadcast functionality
With Ingo Molnar <mingo@elte.hu> Add broadcast functionality, so per cpu clock event devices can be registered as dummy devices or switched from/to broadcast on demand. The broadcast function distributes the events via the broadcast function of the clock event device. This is primarily designed to replace the switch apic timer to / from IPI in power states, where the apic stops. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: john stultz <johnstul@us.ibm.com> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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}