Lines Matching full:pic

196 	mtx_init(&pic_list_lock, "intr pic list", NULL, MTX_DEF);  in intr_irq_init()
550 * A support function for a PIC to decide if provided ISRC should be inited
658 * In NOCPU case, it's up to PIC to either leave ISRC on same CPU or in intr_isrc_assign_cpu()
660 * PIC is expected to change isrc_cpu appropriately to keep us well in intr_isrc_assign_cpu()
763 struct intr_pic *pic; local
770 /* Note that pic->pic_dev is never NULL on registered PIC. */
771 SLIST_FOREACH(pic, &pic_list, pic_next) {
772 if ((pic->pic_flags & FLAG_TYPE_MASK) !=
777 if (xref == pic->pic_xref)
778 return (pic);
779 } else if (xref == 0 || pic->pic_xref == 0) {
780 if (dev == pic->pic_dev)
781 return (pic);
782 } else if (xref == pic->pic_xref && dev == pic->pic_dev)
783 return (pic);
794 struct intr_pic *pic; local
797 pic = pic_lookup_locked(dev, xref, flags);
799 return (pic);
808 struct intr_pic *pic; local
811 pic = pic_lookup_locked(dev, xref, flags);
812 if (pic != NULL) {
814 return (pic);
816 pic = malloc(sizeof(*pic), M_INTRNG, M_NOWAIT | M_ZERO);
817 if (pic == NULL) {
821 pic->pic_xref = xref;
822 pic->pic_dev = dev;
823 pic->pic_flags = flags;
824 mtx_init(&pic->pic_child_lock, "pic child lock", NULL, MTX_SPIN);
825 SLIST_INSERT_HEAD(&pic_list, pic, pic_next);
828 return (pic);
837 struct intr_pic *pic; local
840 pic = pic_lookup_locked(dev, xref, flags);
841 if (pic == NULL) {
845 SLIST_REMOVE(&pic_list, pic, intr_pic, pic_next);
848 free(pic, M_INTRNG);
857 struct intr_pic *pic; local
861 pic = pic_create(dev, xref, FLAG_PIC);
862 if (pic == NULL)
865 debugf("PIC %p registered for %s <dev %p, xref %jx>\n", pic,
867 return (pic);
884 * in interrupt controller's tree. So root PIC must claim itself as a root.
896 struct intr_pic *pic; local
899 pic = pic_lookup(dev, xref, FLAG_PIC);
900 if (pic == NULL) {
905 KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_PIC,
906 ("%s: Found a non-PIC controller: %s", __func__,
907 device_get_name(pic->pic_dev)));
939 intr_pic_add_handler(device_t parent, struct intr_pic *pic, argument
949 /* Find the parent PIC */
955 newchild->pc_pic = pic;
964 KASSERT(child->pc_pic != pic, ("%s: Adding a child PIC twice",
978 struct intr_pic *pic; local
984 pic = pic_lookup(dev, xref,
986 if (pic == NULL)
991 KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_MSI,
993 device_get_name(pic->pic_dev)));
999 KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_PIC,
1000 ("%s: Found a non-PIC controller: %s", __func__,
1001 device_get_name(pic->pic_dev)));
1002 return (PIC_MAP_INTR(pic->pic_dev, data, isrc));
1355 struct intr_pic *pic; local
1359 pic = pic_create(dev, xref, FLAG_MSI);
1360 if (pic == NULL)
1363 debugf("PIC %p registered for %s <dev %p, xref %jx>\n", pic,
1374 struct intr_pic *pic; local
1379 pic = pic_lookup(NULL, xref, FLAG_MSI);
1380 if (pic == NULL)
1383 KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_MSI,
1385 device_get_name(pic->pic_dev)));
1391 err = MSI_IOMMU_INIT(pic->pic_dev, child, &domain);
1396 err = MSI_ALLOC_MSI(pic->pic_dev, child, count, maxcount, &pdev, isrc);
1408 irqs[i] = intr_map_irq(pic->pic_dev, xref,
1421 struct intr_pic *pic; local
1425 pic = pic_lookup(NULL, xref, FLAG_MSI);
1426 if (pic == NULL)
1429 KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_MSI,
1431 device_get_name(pic->pic_dev)));
1444 MSI_IOMMU_DEINIT(pic->pic_dev, child);
1446 err = MSI_RELEASE_MSI(pic->pic_dev, child, count, isrc);
1462 struct intr_pic *pic; local
1467 pic = pic_lookup(NULL, xref, FLAG_MSI);
1468 if (pic == NULL)
1471 KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_MSI,
1473 device_get_name(pic->pic_dev)));
1479 err = MSI_IOMMU_INIT(pic->pic_dev, child, &domain);
1483 err = MSI_ALLOC_MSIX(pic->pic_dev, child, &pdev, &isrc);
1491 *irq = intr_map_irq(pic->pic_dev, xref, (struct intr_map_data *)msi);
1499 struct intr_pic *pic; local
1503 pic = pic_lookup(NULL, xref, FLAG_MSI);
1504 if (pic == NULL)
1507 KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_MSI,
1509 device_get_name(pic->pic_dev)));
1522 MSI_IOMMU_DEINIT(pic->pic_dev, child);
1524 err = MSI_RELEASE_MSIX(pic->pic_dev, child, isrc);
1535 struct intr_pic *pic; local
1538 pic = pic_lookup(NULL, xref, FLAG_MSI);
1539 if (pic == NULL)
1542 KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_MSI,
1544 device_get_name(pic->pic_dev)));
1550 err = MSI_MAP_MSI(pic->pic_dev, child, isrc, addr, data);
1880 panic("%s: no IPI PIC attached", __func__);