Lines Matching defs:smc
19 #include "h/smc.h"
21 static void timer_done(struct s_smc *smc, int restart);
23 void smt_timer_init(struct s_smc *smc)
25 smc->t.st_queue = NULL;
26 smc->t.st_fast.tm_active = FALSE ;
27 smc->t.st_fast.tm_next = NULL;
28 hwt_init(smc) ;
31 void smt_timer_stop(struct s_smc *smc, struct smt_timer *timer)
40 if (smc->t.st_queue == timer && !timer->tm_next) {
41 hwt_stop(smc) ;
43 for (prev = &smc->t.st_queue ; (tm = *prev) ; prev = &tm->tm_next ) {
54 void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time,
64 smt_timer_stop(smc,timer) ;
65 timer->tm_smc = smc ;
68 if (!smc->t.st_queue) {
69 smc->t.st_queue = timer ;
72 hwt_start(smc,time) ;
78 timer_done(smc,0) ;
84 for (prev = &smc->t.st_queue ; (tm = *prev) ; prev = &tm->tm_next ) {
99 hwt_start(smc,smc->t.st_queue->tm_delta) ;
102 void smt_force_irq(struct s_smc *smc)
104 smt_timer_start(smc,&smc->t.st_fast,32L, EV_TOKEN(EVENT_SMT,SM_FAST));
107 void smt_timer_done(struct s_smc *smc)
109 timer_done(smc,1) ;
112 static void timer_done(struct s_smc *smc, int restart)
120 delta = hwt_read(smc) ;
121 last = &smc->t.st_queue ;
122 tm = smc->t.st_queue ;
137 next = smc->t.st_queue ;
138 smc->t.st_queue = tm ;
142 timer_event(smc,tm->tm_token) ;
145 if (restart && smc->t.st_queue)
146 hwt_start(smc,smc->t.st_queue->tm_delta) ;