15 #include <asm/timex.h>
19 #if (CONFIG_NR_CPUS > 2) && !defined(CONFIG_GEENERIC_CLOCKEVENTS_BROADCAST)
20 #error "This doesn't scale well! Need per-core local timers."
23 #define stop_jiffies_counter1()
24 #define reload_jiffies_counter1(x)
25 #define TMJC1IRQ TMJCIRQ
29 static int next_event(
unsigned long delta,
30 struct clock_event_device *
evt)
35 stop_jiffies_counter();
36 reload_jiffies_counter(delta - 1);
44 static void set_clock_mode(
enum clock_event_mode
mode,
45 struct clock_event_device *
evt)
50 static DEFINE_PER_CPU(
struct clock_event_device, mn10300_clockevent_device);
55 struct clock_event_device *
cd;
59 stop_jiffies_counter();
63 cd = &
per_cpu(mn10300_clockevent_device, cpu);
64 cd->event_handler(cd);
73 static inline void setup_jiffies_interrupt(
int irq,
79 GxICR(irq) |= GxICR_ENABLE | GxICR_DETECT | GxICR_REQUEST;
85 struct clock_event_device *
cd;
89 cd = &
per_cpu(mn10300_clockevent_device, cpu);
92 stop_jiffies_counter();
99 cd->name =
"Timestamp";
100 cd->features = CLOCK_EVT_FEAT_ONESHOT;
111 cd->set_mode = set_clock_mode;
113 cd->set_next_event = next_event;
121 #if defined(CONFIG_SMP) && !defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
133 iact->
name =
"CPU0 Timer";
136 iact->
name =
"CPU1 Timer";
139 setup_jiffies_interrupt(cd->irq, iact);