Lines Matching refs:hdl

146 static TEE_Result add_configure_handler(struct itr_handler *hdl,  in add_configure_handler()  argument
153 assert(hdl && hdl->chip->ops && is_unpaged(hdl) && in add_configure_handler()
154 hdl->handler && is_unpaged(hdl->handler)); in add_configure_handler()
156 SLIST_FOREACH(h, &hdl->chip->handlers, link) { in add_configure_handler()
157 if (h->it == hdl->it && in add_configure_handler()
158 (!(hdl->flags & ITRF_SHARED) || in add_configure_handler()
161 hdl->chip->name, hdl->it); in add_configure_handler()
167 res = interrupt_configure(hdl->chip, hdl->it, type, prio); in add_configure_handler()
172 SLIST_INSERT_HEAD(&hdl->chip->handlers, hdl, link); in add_configure_handler()
177 TEE_Result interrupt_add_configure_handler(struct itr_handler *hdl, in interrupt_add_configure_handler() argument
180 return add_configure_handler(hdl, type, prio, true /* configure */); in interrupt_add_configure_handler()
215 void interrupt_remove_handler(struct itr_handler *hdl) in interrupt_remove_handler() argument
220 if (!hdl) in interrupt_remove_handler()
223 SLIST_FOREACH(h, &hdl->chip->handlers, link) in interrupt_remove_handler()
224 if (h == hdl) in interrupt_remove_handler()
227 DMSG("Invalid %s:%zu", hdl->chip->name, hdl->it); in interrupt_remove_handler()
232 if (hdl->flags & ITRF_SHARED) { in interrupt_remove_handler()
233 SLIST_FOREACH(h, &hdl->chip->handlers, link) { in interrupt_remove_handler()
234 if (h != hdl && h->it == hdl->it) { in interrupt_remove_handler()
242 interrupt_disable(hdl->chip, hdl->it); in interrupt_remove_handler()
244 SLIST_REMOVE(&hdl->chip->handlers, hdl, itr_handler, link); in interrupt_remove_handler()
255 struct itr_handler *hdl = NULL; in interrupt_alloc_add_conf_handler() local
257 hdl = calloc(1, sizeof(*hdl)); in interrupt_alloc_add_conf_handler()
258 if (!hdl) in interrupt_alloc_add_conf_handler()
261 *hdl = ITR_HANDLER(chip, itr_num, flags, handler, data); in interrupt_alloc_add_conf_handler()
263 res = interrupt_add_configure_handler(hdl, type, prio); in interrupt_alloc_add_conf_handler()
265 free(hdl); in interrupt_alloc_add_conf_handler()
270 *out_hdl = hdl; in interrupt_alloc_add_conf_handler()
275 void interrupt_remove_free_handler(struct itr_handler *hdl) in interrupt_remove_free_handler() argument
277 if (hdl) { in interrupt_remove_free_handler()
278 interrupt_remove_handler(hdl); in interrupt_remove_free_handler()
279 free(hdl); in interrupt_remove_free_handler()