MCPcopy Create free account
hub / github.com/F-Stack/f-stack / intr_pic_add_handler

Function intr_pic_add_handler

freebsd/kern/subr_intr.c:892–926  ·  view source on GitHub ↗

* Add a handler to manage a sub range of a parents interrupts. */

Source from the content-addressed store, hash-verified

890 * Add a handler to manage a sub range of a parents interrupts.
891 */
892struct intr_pic *
893intr_pic_add_handler(device_t parent, struct intr_pic *pic,
894 intr_child_irq_filter_t *filter, void *arg, uintptr_t start,
895 uintptr_t length)
896{
897 struct intr_pic *parent_pic;
898 struct intr_pic_child *newchild;
899#ifdef INVARIANTS
900 struct intr_pic_child *child;
901#endif
902
903 /* Find the parent PIC */
904 parent_pic = pic_lookup(parent, 0, FLAG_PIC);
905 if (parent_pic == NULL)
906 return (NULL);
907
908 newchild = malloc(sizeof(*newchild), M_INTRNG, M_WAITOK | M_ZERO);
909 newchild->pc_pic = pic;
910 newchild->pc_filter = filter;
911 newchild->pc_filter_arg = arg;
912 newchild->pc_start = start;
913 newchild->pc_length = length;
914
915 mtx_lock_spin(&parent_pic->pic_child_lock);
916#ifdef INVARIANTS
917 SLIST_FOREACH(child, &parent_pic->pic_children, pc_next) {
918 KASSERT(child->pc_pic != pic, ("%s: Adding a child PIC twice",
919 __func__));
920 }
921#endif
922 SLIST_INSERT_HEAD(&parent_pic->pic_children, newchild, pc_next);
923 mtx_unlock_spin(&parent_pic->pic_child_lock);
924
925 return (pic);
926}
927
928static int
929intr_resolve_irq(device_t dev, intptr_t xref, struct intr_map_data *data,

Callers 2

gicv3_its_fdt_attachFunction · 0.85
gicv3_its_acpi_attachFunction · 0.85

Calls 2

pic_lookupFunction · 0.85
mallocFunction · 0.85

Tested by

no test coverage detected