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

Function dmar_dev_path

freebsd/x86/iommu/intel_drv.c:628–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628void
629dmar_dev_path(device_t child, int *busno, void *path1, int depth)
630{
631 devclass_t pci_class;
632 device_t bus, pcib;
633 ACPI_DMAR_PCI_PATH *path;
634
635 pci_class = devclass_find("pci");
636 path = path1;
637 for (depth--; depth != -1; depth--) {
638 path[depth].Device = pci_get_slot(child);
639 path[depth].Function = pci_get_function(child);
640 bus = device_get_parent(child);
641 pcib = device_get_parent(bus);
642 if (device_get_devclass(device_get_parent(pcib)) !=
643 pci_class) {
644 /* reached a host bridge */
645 *busno = pcib_get_bus(bus);
646 return;
647 }
648 child = pcib;
649 }
650 panic("wrong depth");
651}
652
653static int
654dmar_match_pathes(int busno1, const ACPI_DMAR_PCI_PATH *path1, int depth1,

Callers 2

dmar_get_ctx_for_devFunction · 0.85
dmar_findFunction · 0.85

Calls 4

devclass_findFunction · 0.85
device_get_parentFunction · 0.85
device_get_devclassFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected