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

Function pic_create

freebsd/kern/subr_intr.c:762–786  ·  view source on GitHub ↗

* Create interrupt controller. */

Source from the content-addressed store, hash-verified

760 * Create interrupt controller.
761 */
762static struct intr_pic *
763pic_create(device_t dev, intptr_t xref, int flags)
764{
765 struct intr_pic *pic;
766
767 mtx_lock(&pic_list_lock);
768 pic = pic_lookup_locked(dev, xref, flags);
769 if (pic != NULL) {
770 mtx_unlock(&pic_list_lock);
771 return (pic);
772 }
773 pic = malloc(sizeof(*pic), M_INTRNG, M_NOWAIT | M_ZERO);
774 if (pic == NULL) {
775 mtx_unlock(&pic_list_lock);
776 return (NULL);
777 }
778 pic->pic_xref = xref;
779 pic->pic_dev = dev;
780 pic->pic_flags = flags;
781 mtx_init(&pic->pic_child_lock, "pic child lock", NULL, MTX_SPIN);
782 SLIST_INSERT_HEAD(&pic_list, pic, pic_next);
783 mtx_unlock(&pic_list_lock);
784
785 return (pic);
786}
787#ifdef notyet
788/*
789 * Destroy interrupt controller.

Callers 2

intr_pic_registerFunction · 0.85
intr_msi_registerFunction · 0.85

Calls 5

pic_lookup_lockedFunction · 0.85
mallocFunction · 0.85
mtx_initFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected