25 #ifndef CONFIG_MIPS_MT_SMTC
27 static int mips_next_event(
unsigned long delta,
28 struct clock_event_device *
evt)
43 struct clock_event_device *evt)
51 #ifndef CONFIG_MIPS_MT_SMTC
56 struct clock_event_device *
cd;
65 if (handle_perf_irq(r2))
76 cd = &
per_cpu(mips_clockevent_device, cpu);
77 cd->event_handler(cd);
100 static int c0_compare_int_pending(
void)
102 #ifdef CONFIG_IRQ_GIC
114 #define COMPARE_INT_SEEN_TICKS 50
124 if (c0_compare_int_pending()) {
127 back_to_back_c0_hazard();
129 if (!c0_compare_int_pending())
131 if (c0_compare_int_pending())
135 for (delta = 0x10; delta <= 0x400000; delta <<= 1) {
139 back_to_back_c0_hazard();
149 if (c0_compare_int_pending())
151 if (!c0_compare_int_pending())
155 back_to_back_c0_hazard();
157 if (!c0_compare_int_pending())
159 if (c0_compare_int_pending())
168 #ifndef CONFIG_MIPS_MT_SMTC
173 struct clock_event_device *
cd;
191 cd = &
per_cpu(mips_clockevent_device, cpu);
194 cd->features = CLOCK_EVT_FEAT_ONESHOT;
205 cd->set_next_event = mips_next_event;
211 if (cp0_timer_irq_installed)
214 cp0_timer_irq_installed = 1;