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

Function intr_map_msi

freebsd/kern/subr_intr.c:1484–1512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1482}
1483
1484int
1485intr_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
1514void dosoftints(void);
1515void

Callers 3

thunder_pem_fdt_map_msiFunction · 0.85
rk_pcie_map_msiFunction · 0.85
tegra_pcib_map_msiFunction · 0.85

Calls 3

pic_lookupFunction · 0.85
device_get_nameFunction · 0.85
intr_map_get_isrcFunction · 0.85

Tested by

no test coverage detected