Lines Matching refs:smc
23 #include "h/smc.h"
29 static void timer_done(struct s_smc *smc, int restart);
31 void smt_timer_init(struct s_smc *smc)
33 smc->t.st_queue = NULL;
34 smc->t.st_fast.tm_active = FALSE ;
35 smc->t.st_fast.tm_next = NULL;
36 hwt_init(smc) ;
39 void smt_timer_stop(struct s_smc *smc, struct smt_timer *timer)
48 if (smc->t.st_queue == timer && !timer->tm_next) {
49 hwt_stop(smc) ;
51 for (prev = &smc->t.st_queue ; (tm = *prev) ; prev = &tm->tm_next ) {
62 void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time,
72 smt_timer_stop(smc,timer) ;
73 timer->tm_smc = smc ;
76 if (!smc->t.st_queue) {
77 smc->t.st_queue = timer ;
80 hwt_start(smc,time) ;
86 timer_done(smc,0) ;
92 for (prev = &smc->t.st_queue ; (tm = *prev) ; prev = &tm->tm_next ) {
107 hwt_start(smc,smc->t.st_queue->tm_delta) ;
110 void smt_force_irq(struct s_smc *smc)
112 smt_timer_start(smc,&smc->t.st_fast,32L, EV_TOKEN(EVENT_SMT,SM_FAST));
115 void smt_timer_done(struct s_smc *smc)
117 timer_done(smc,1) ;
120 static void timer_done(struct s_smc *smc, int restart)
128 delta = hwt_read(smc) ;
129 last = &smc->t.st_queue ;
130 tm = smc->t.st_queue ;
145 next = smc->t.st_queue ;
146 smc->t.st_queue = tm ;
150 timer_event(smc,tm->tm_token) ;
153 if (restart && smc->t.st_queue)
154 hwt_start(smc,smc->t.st_queue->tm_delta) ;