MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mv_timer_start

Function mv_timer_start

freebsd/arm/mv/timer.c:509–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507}
508
509static int
510mv_timer_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
511{
512 struct mv_timer_softc *sc;
513 uint32_t val, val1;
514
515 /* Calculate dividers. */
516 sc = (struct mv_timer_softc *)et->et_priv;
517 if (period != 0)
518 val = ((uint32_t)sc->et.et_frequency * period) >> 32;
519 else
520 val = 0;
521 if (first != 0)
522 val1 = ((uint32_t)sc->et.et_frequency * first) >> 32;
523 else
524 val1 = val;
525
526 /* Apply configuration. */
527 mv_set_timer_rel(0, val);
528 mv_set_timer(0, val1);
529 val = mv_get_timer_control();
530 val |= CPU_TIMER0_EN;
531 if (period != 0)
532 val |= CPU_TIMER0_AUTO;
533 else
534 val &= ~CPU_TIMER0_AUTO;
535 mv_set_timer_control(val);
536 return (0);
537}
538
539static int
540mv_timer_stop(struct eventtimer *et)

Callers

nothing calls this directly

Calls 4

mv_set_timer_relFunction · 0.85
mv_set_timerFunction · 0.70
mv_get_timer_controlFunction · 0.70
mv_set_timer_controlFunction · 0.70

Tested by

no test coverage detected