Lines Matching defs:smc
19 #include "h/smc.h"
25 static void timer_done(struct s_smc *smc, int restart);
27 void smt_timer_init(struct s_smc *smc)
29 smc->t.st_queue = NULL;
30 smc->t.st_fast.tm_active = FALSE ;
31 smc->t.st_fast.tm_next = NULL;
32 hwt_init(smc) ;
35 void smt_timer_stop(struct s_smc *smc, struct smt_timer *timer)
44 if (smc->t.st_queue == timer && !timer->tm_next) {
45 hwt_stop(smc) ;
47 for (prev = &smc->t.st_queue ; (tm = *prev) ; prev = &tm->tm_next ) {
58 void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time,
68 smt_timer_stop(smc,timer) ;
69 timer->tm_smc = smc ;
72 if (!smc->t.st_queue) {
73 smc->t.st_queue = timer ;
76 hwt_start(smc,time) ;
82 timer_done(smc,0) ;
88 for (prev = &smc->t.st_queue ; (tm = *prev) ; prev = &tm->tm_next ) {
103 hwt_start(smc,smc->t.st_queue->tm_delta) ;
106 void smt_force_irq(struct s_smc *smc)
108 smt_timer_start(smc,&smc->t.st_fast,32L, EV_TOKEN(EVENT_SMT,SM_FAST));
111 void smt_timer_done(struct s_smc *smc)
113 timer_done(smc,1) ;
116 static void timer_done(struct s_smc *smc, int restart)
124 delta = hwt_read(smc) ;
125 last = &smc->t.st_queue ;
126 tm = smc->t.st_queue ;
141 next = smc->t.st_queue ;
142 smc->t.st_queue = tm ;
146 timer_event(smc,tm->tm_token) ;
149 if (restart && smc->t.st_queue)
150 hwt_start(smc,smc->t.st_queue->tm_delta) ;