Lines Matching full:et

45 static SYSCTL_NODE(_kern_eventtimer, OID_AUTO, et,
53 et_register(struct eventtimer *et) in et_register() argument
57 if (et->et_quality >= 0 || bootverbose) { in et_register()
58 if (et->et_frequency == 0) { in et_register()
60 et->et_name, et->et_quality); in et_register()
64 et->et_name, (uintmax_t)et->et_frequency, in et_register()
65 et->et_quality); in et_register()
68 KASSERT(et->et_start, ("et_register: timer has no start function")); in et_register()
69 et->et_sysctl = SYSCTL_ADD_NODE_WITH_LABEL(NULL, in et_register()
70 SYSCTL_STATIC_CHILDREN(_kern_eventtimer_et), OID_AUTO, et->et_name, in et_register()
73 SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, in et_register()
74 "flags", CTLFLAG_RD, &(et->et_flags), 0, in et_register()
76 SYSCTL_ADD_UQUAD(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, in et_register()
77 "frequency", CTLFLAG_RD, &(et->et_frequency), in et_register()
79 SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, in et_register()
80 "quality", CTLFLAG_RD, &(et->et_quality), 0, in et_register()
84 SLIST_FIRST(&eventtimers)->et_quality < et->et_quality) { in et_register()
85 SLIST_INSERT_HEAD(&eventtimers, et, et_all); in et_register()
89 if (next == NULL || next->et_quality < et->et_quality) { in et_register()
90 SLIST_INSERT_AFTER(tmp, et, et_all); in et_register()
103 et_deregister(struct eventtimer *et) in et_deregister() argument
107 if (et->et_deregister_cb != NULL) { in et_deregister()
108 if ((err = et->et_deregister_cb(et, et->et_arg)) != 0) in et_deregister()
113 SLIST_REMOVE(&eventtimers, et, eventtimer, et_all); in et_deregister()
115 sysctl_remove_oid(et->et_sysctl, 1, 1); in et_deregister()
125 et_change_frequency(struct eventtimer *et, uint64_t newfreq) in et_change_frequency() argument
128 cpu_et_frequency(et, newfreq); in et_change_frequency()
137 struct eventtimer *et = NULL; in et_find() local
139 SLIST_FOREACH(et, &eventtimers, et_all) { in et_find()
140 if (et->et_active) in et_find()
142 if (name != NULL && strcasecmp(et->et_name, name) != 0) in et_find()
144 if (name == NULL && et->et_quality < 0) in et_find()
146 if ((et->et_flags & check) != want) in et_find()
150 return (et); in et_find()
157 et_init(struct eventtimer *et, et_event_cb_t *event, in et_init() argument
163 if (et->et_active) in et_init()
166 et->et_active = 1; in et_init()
167 et->et_event_cb = event; in et_init()
168 et->et_deregister_cb = deregister; in et_init()
169 et->et_arg = arg; in et_init()
179 et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) in et_start() argument
182 if (!et->et_active) in et_start()
185 KASSERT((et->et_flags & ET_FLAGS_PERIODIC) || period == 0, in et_start()
187 KASSERT((et->et_flags & ET_FLAGS_ONESHOT) || period != 0, in et_start()
190 if (period < et->et_min_period) in et_start()
191 period = et->et_min_period; in et_start()
192 else if (period > et->et_max_period) in et_start()
193 period = et->et_max_period; in et_start()
196 if (first < et->et_min_period) in et_start()
197 first = et->et_min_period; in et_start()
198 else if (first > et->et_max_period) in et_start()
199 first = et->et_max_period; in et_start()
201 return (et->et_start(et, first, period)); in et_start()
206 et_stop(struct eventtimer *et) in et_stop() argument
209 if (!et->et_active) in et_stop()
211 if (et->et_stop) in et_stop()
212 return (et->et_stop(et)); in et_stop()
218 et_ban(struct eventtimer *et) in et_ban() argument
221 et->et_flags &= ~(ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT); in et_ban()
227 et_free(struct eventtimer *et) in et_free() argument
230 if (!et->et_active) in et_free()
233 et->et_active = 0; in et_free()
242 struct eventtimer *et; in sysctl_kern_eventtimer_choice() local
248 SLIST_FOREACH(et, &eventtimers, et_all) { in sysctl_kern_eventtimer_choice()
249 if (et != SLIST_FIRST(&eventtimers)) in sysctl_kern_eventtimer_choice()
251 sbuf_printf(&sb, "%s(%d)", et->et_name, et->et_quality); in sysctl_kern_eventtimer_choice()