| 1482 | } |
| 1483 | |
| 1484 | int |
| 1485 | intr_map_msi(device_t pci, device_t child, intptr_t xref, int irq, |
| 1486 | uint64_t *addr, uint32_t *data) |
| 1487 | { |
| 1488 | struct intr_irqsrc *isrc; |
| 1489 | struct intr_pic *pic; |
| 1490 | int err; |
| 1491 | |
| 1492 | pic = pic_lookup(NULL, xref, FLAG_MSI); |
| 1493 | if (pic == NULL) |
| 1494 | return (ESRCH); |
| 1495 | |
| 1496 | KASSERT((pic->pic_flags & FLAG_TYPE_MASK) == FLAG_MSI, |
| 1497 | ("%s: Found a non-MSI controller: %s", __func__, |
| 1498 | device_get_name(pic->pic_dev))); |
| 1499 | |
| 1500 | isrc = intr_map_get_isrc(irq); |
| 1501 | if (isrc == NULL) |
| 1502 | return (EINVAL); |
| 1503 | |
| 1504 | err = MSI_MAP_MSI(pic->pic_dev, child, isrc, addr, data); |
| 1505 | |
| 1506 | #ifdef IOMMU |
| 1507 | if (isrc->isrc_iommu != NULL) |
| 1508 | iommu_translate_msi(isrc->isrc_iommu, addr); |
| 1509 | #endif |
| 1510 | |
| 1511 | return (err); |
| 1512 | } |
| 1513 | |
| 1514 | void dosoftints(void); |
| 1515 | void |
no test coverage detected