Lines Matching refs:timer
368 int timer[EMU_MAX_IRQ_CONSUMERS]; /* timer */
808 * emu_timer_ - HW timer management
813 int i, timer;
815 timer = -1;
819 if (sc->timer[i] == 0) {
820 sc->timer[i] = -1; /* disable it */
821 timer = i;
823 return (timer);
831 emu_timer_set(struct emu_sc_info *sc, int timer, int delay)
835 if (timer < 0)
839 RANGE(timer, 0, EMU_MAX_IRQ_CONSUMERS-1);
842 sc->timer[timer] = delay;
844 if (sc->timerinterval > sc->timer[i])
845 sc->timerinterval = sc->timer[i];
851 return (timer);
855 emu_timer_enable(struct emu_sc_info *sc, int timer, int go)
861 if (timer < 0)
864 RANGE(timer, 0, EMU_MAX_IRQ_CONSUMERS-1);
868 if ((go == 1) && (sc->timer[timer] < 0))
869 sc->timer[timer] = -sc->timer[timer];
870 if ((go == 0) && (sc->timer[timer] > 0))
871 sc->timer[timer] = -sc->timer[timer];
875 if (sc->timerinterval > sc->timer[i])
876 sc->timerinterval = sc->timer[i];
877 if (sc->timer[i] > 0)
897 emu_timer_clear(struct emu_sc_info *sc, int timer)
899 if (timer < 0)
902 RANGE(timer, 0, EMU_MAX_IRQ_CONSUMERS-1);
904 emu_timer_enable(sc, timer, 0);
907 if (sc->timer[timer] != 0)
908 sc->timer[timer] = 0;
911 return (timer);
3179 sc->timer[i] = 0; /* disable it */