Skip to content

Commit

Permalink
ARC: SMP resurrect #19: clockevent routines rename - nothing semantical
Browse files Browse the repository at this point in the history
Signed-off-by: Vineet Gupta <[email protected]>
  • Loading branch information
vineetgarc committed Nov 19, 2012
1 parent f7be1c1 commit b0ce701
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions arch/arc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ static inline void arch_idle(void)

void cpu_idle(void)
{
/* Since we SLEEP in idle loop, TIF_POLLING_NRFLAG can't be set */

/* endless idle loop with no priority at all */
while (1) {
tick_nohz_stop_sched_tick(1);
Expand Down
23 changes: 12 additions & 11 deletions arch/arc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/*
* Arm the timer to interrupt after @limit cycles
*/
static void arc_timer0_setup_event(unsigned int limit)
static void arc_periodic_timer_setup(unsigned int limit)
{
/* setup start and end markers */
write_aux_reg(ARC_REG_TIMER0_LIMIT, limit);
Expand All @@ -63,7 +63,7 @@ static void arc_timer0_setup_event(unsigned int limit)
/*
* Acknowledge the interrupt & enable/disable the interrupt
*/
static void arc_timer0_ack_event(unsigned int irq_reenable)
static void arc_periodic_timer_ack(unsigned int irq_reenable)
{
/* 1. Ack the interrupt by writing to CTRL reg.
* Any write will cause intr to be ack, however it has to be one of
Expand Down Expand Up @@ -122,19 +122,20 @@ void __cpuinit arc_clocksource_init(void)

/********** Clock Event Device *********/

static int arc_next_event(unsigned long delta, struct clock_event_device *dev)
static int arc_clkevent_set_next_event(unsigned long delta,
struct clock_event_device *dev)
{
arc_timer0_setup_event(delta);
arc_periodic_timer_setup(delta);
return 0;
}

static void arc_set_mode(enum clock_event_mode mode,
struct clock_event_device *dev)
static void arc_clkevent_set_mode(enum clock_event_mode mode,
struct clock_event_device *dev)
{
pr_info("Device [%s] clockevent mode now [%d]\n", dev->name, mode);
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
arc_timer0_setup_event(CONFIG_ARC_PLAT_CLK / HZ);
arc_periodic_timer_setup(CONFIG_ARC_PLAT_CLK / HZ);
break;
case CLOCK_EVT_MODE_ONESHOT:
break;
Expand All @@ -150,9 +151,9 @@ static DEFINE_PER_CPU(struct clock_event_device, arc_clockevent_device) = {
.features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
.mode = CLOCK_EVT_MODE_UNUSED,
.rating = 300,
.irq = TIMER0_INT,
.set_next_event = arc_next_event,
.set_mode = arc_set_mode,
.irq = TIMER0_INT, /* hardwired, no need for resources */
.set_next_event = arc_clkevent_set_next_event,
.set_mode = arc_clkevent_set_mode,
};

static irqreturn_t timer_irq_handler(int irq, void *dev_id);
Expand All @@ -169,7 +170,7 @@ irqreturn_t timer_irq_handler(int irq, void *dev_id)
unsigned int cpu = smp_processor_id();
struct clock_event_device *evt = &per_cpu(arc_clockevent_device, cpu);

arc_timer0_ack_event(evt->mode == CLOCK_EVT_MODE_PERIODIC);
arc_periodic_timer_ack(evt->mode == CLOCK_EVT_MODE_PERIODIC);
evt->event_handler(evt);
return IRQ_HANDLED;
}
Expand Down

0 comments on commit b0ce701

Please sign in to comment.