diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2007-02-16 04:28:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-16 11:13:59 -0500 |
commit | f8381cba04ba8173fd5a2b8e5cd8b3290ee13a98 (patch) | |
tree | ad8c9f91ce031a04c62ff75fcd3237fc666f1c2e /kernel/time/tick-internal.h | |
parent | 906568c9c668ff994f4078932ec6ae1e3950d1af (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.h | 65 |
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 | */ | ||
4 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); | ||
5 | extern spinlock_t tick_device_lock; | ||
6 | extern ktime_t tick_next_period; | ||
7 | extern ktime_t tick_period; | ||
8 | |||
9 | extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast); | ||
10 | extern void tick_handle_periodic(struct clock_event_device *dev); | ||
11 | |||
12 | /* | ||
13 | * Broadcasting support | ||
14 | */ | ||
15 | #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | ||
16 | extern int tick_do_broadcast(cpumask_t mask); | ||
17 | extern struct tick_device tick_broadcast_device; | ||
18 | extern spinlock_t tick_broadcast_lock; | ||
19 | |||
20 | extern int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu); | ||
21 | extern int tick_check_broadcast_device(struct clock_event_device *dev); | ||
22 | extern int tick_is_broadcast_device(struct clock_event_device *dev); | ||
23 | extern void tick_broadcast_on_off(unsigned long reason, int *oncpu); | ||
24 | extern void tick_shutdown_broadcast(unsigned int *cpup); | ||
25 | |||
26 | extern void | ||
27 | tick_set_periodic_handler(struct clock_event_device *dev, int broadcast); | ||
28 | |||
29 | #else /* !BROADCAST */ | ||
30 | |||
31 | static inline int tick_check_broadcast_device(struct clock_event_device *dev) | ||
32 | { | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | static inline int tick_is_broadcast_device(struct clock_event_device *dev) | ||
37 | { | ||
38 | return 0; | ||
39 | } | ||
40 | static inline int tick_device_uses_broadcast(struct clock_event_device *dev, | ||
41 | int cpu) | ||
42 | { | ||
43 | return 0; | ||
44 | } | ||
45 | static inline void tick_do_periodic_broadcast(struct clock_event_device *d) { } | ||
46 | static inline void tick_broadcast_on_off(unsigned long reason, int *oncpu) { } | ||
47 | static inline void tick_shutdown_broadcast(unsigned int *cpup) { } | ||
48 | |||
49 | /* | ||
50 | * Set the periodic handler in non broadcast mode | ||
51 | */ | ||
52 | static 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 | */ | ||
62 | static inline int tick_device_is_functional(struct clock_event_device *dev) | ||
63 | { | ||
64 | return !(dev->features & CLOCK_EVT_FEAT_DUMMY); | ||
65 | } | ||