48 static int smtc_nextinvpe[
NR_CPUS];
60 #define MAKEVALID(x) (((x) == 0L) ? 1L : (x))
61 #define ISVALID(x) ((x) != 0L)
68 #define IS_SOONER(a, b, reference) \
69 (((a) - (unsigned long)(reference)) < ((b) - (unsigned long)(reference)))
76 #define CATCHUP_INCREMENT 64
78 static int mips_next_event(
unsigned long delta,
79 struct clock_event_device *
evt)
84 unsigned long nextcomp = 0
L;
106 if (cpu == smtc_nextinvpe[vpe] &&
ISVALID(previous)
107 &&
IS_SOONER(previous, timestamp, reference)) {
124 smtc_nextinvpe[vpe] = soonest;
134 smtc_nextinvpe[vpe] =
cpu;
174 unsigned int mtflags;
176 struct clock_event_device *
cd;
177 unsigned long nextstamp;
204 cd = &
per_cpu(mips_clockevent_device, cpu);
205 cd->event_handler(cd);
212 smtc_nextinvpe[vpe] =
cpu;
255 struct clock_event_device *
cd;
264 smtc_nextinvpe[
i] = 0;
285 cd = &
per_cpu(mips_clockevent_device, cpu);
288 cd->features = CLOCK_EVT_FEAT_ONESHOT;
291 cd->mult = div_sc((
unsigned long) mips_freq,
NSEC_PER_SEC, 32);
299 cd->set_next_event = mips_next_event;