[PATCH] clockevents: add core functionality

Architectures register their clock event devices, in the clock events core.
Users of the clockevents core can get clock event devices for their use.  The
clockevents core code provides notification mechanisms for various clock
related management events.

This allows to control the clock event devices without the architectures
having to worry about the details of function assignment.  This is also a
preliminary for high resolution timers and dynamic ticks to allow the core
code to control the clock functionality without intrusive changes to the
architecture code.

[Fixes-by: Ingo Molnar <mingo@elte.hu>]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Thomas Gleixner
2007-02-16 01:28:00 -08:00
committed by Linus Torvalds
parent e05d723f98
commit d316c57ff6
6 changed files with 497 additions and 14 deletions

View File

@ -46,7 +46,7 @@
*
* returns the time in ktime_t format
*/
static ktime_t ktime_get(void)
ktime_t ktime_get(void)
{
struct timespec now;
@ -60,7 +60,7 @@ static ktime_t ktime_get(void)
*
* returns the time in ktime_t format
*/
static ktime_t ktime_get_real(void)
ktime_t ktime_get_real(void)
{
struct timespec now;
@ -310,14 +310,6 @@ static unsigned long ktime_divns(const ktime_t kt, s64 div)
# define ktime_divns(kt, div) (unsigned long)((kt).tv64 / (div))
#endif /* BITS_PER_LONG >= 64 */
/*
* Timekeeping resumed notification
*/
void hrtimer_notify_resume(void)
{
clock_was_set();
}
/*
* Counterpart to lock_timer_base above:
*/
@ -889,6 +881,7 @@ static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self,
#ifdef CONFIG_HOTPLUG_CPU
case CPU_DEAD:
clockevents_notify(CLOCK_EVT_NOTIFY_CPU_DEAD, &cpu);
migrate_hrtimers(cpu);
break;
#endif