2008-08-06 18:37:07 +09:00
/*
* Dummy local timer
*
* Copyright ( C ) 2008 Paul Mundt
*
* cloned from :
*
* linux / arch / arm / mach - realview / localtimer . c
*
* Copyright ( C ) 2002 ARM Ltd .
* All Rights Reserved
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation .
*/
# include <linux/init.h>
# include <linux/kernel.h>
# include <linux/delay.h>
# include <linux/device.h>
# include <linux/smp.h>
# include <linux/jiffies.h>
# include <linux/percpu.h>
# include <linux/clockchips.h>
2009-08-19 17:53:04 +09:00
# include <linux/hardirq.h>
2008-08-06 18:37:07 +09:00
# include <linux/irq.h>
static DEFINE_PER_CPU ( struct clock_event_device , local_clockevent ) ;
/*
* Used on SMP for either the local timer or SMP_MSG_TIMER
*/
void local_timer_interrupt ( void )
{
struct clock_event_device * clk = & __get_cpu_var ( local_clockevent ) ;
2009-08-19 17:53:04 +09:00
irq_enter ( ) ;
2008-08-06 18:37:07 +09:00
clk - > event_handler ( clk ) ;
2009-08-19 17:53:04 +09:00
irq_exit ( ) ;
2008-08-06 18:37:07 +09:00
}
static void dummy_timer_set_mode ( enum clock_event_mode mode ,
struct clock_event_device * clk )
{
}
2010-03-30 12:38:01 +09:00
void local_timer_setup ( unsigned int cpu )
2008-08-06 18:37:07 +09:00
{
struct clock_event_device * clk = & per_cpu ( local_clockevent , cpu ) ;
clk - > name = " dummy_timer " ;
2009-08-19 17:53:04 +09:00
clk - > features = CLOCK_EVT_FEAT_ONESHOT |
CLOCK_EVT_FEAT_PERIODIC |
CLOCK_EVT_FEAT_DUMMY ;
clk - > rating = 400 ;
2008-08-06 18:37:07 +09:00
clk - > mult = 1 ;
clk - > set_mode = dummy_timer_set_mode ;
clk - > broadcast = smp_timer_broadcast ;
2008-12-13 21:20:26 +10:30
clk - > cpumask = cpumask_of ( cpu ) ;
2008-08-06 18:37:07 +09:00
clockevents_register_device ( clk ) ;
}
2010-04-26 19:08:55 +09:00
void local_timer_stop ( unsigned int cpu )
{
}