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

Function ppt_unassign_device

freebsd/amd64/vmm/io/ppt.c:402–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402int
403ppt_unassign_device(struct vm *vm, int bus, int slot, int func)
404{
405 struct pptdev *ppt;
406 int error;
407
408 error = ppt_find(vm, bus, slot, func, &ppt);
409 if (error)
410 return (error);
411
412 pci_save_state(ppt->dev);
413 ppt_pci_reset(ppt->dev);
414 pci_restore_state(ppt->dev);
415 ppt_unmap_mmio(vm, ppt);
416 ppt_teardown_msi(ppt);
417 ppt_teardown_msix(ppt);
418 iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev));
419 ppt->vm = NULL;
420 return (0);
421}
422
423int
424ppt_unassign_all(struct vm *vm)

Callers 1

vm_unassign_pptdevFunction · 0.85

Calls 7

ppt_findFunction · 0.85
ppt_pci_resetFunction · 0.85
ppt_unmap_mmioFunction · 0.85
ppt_teardown_msiFunction · 0.85
ppt_teardown_msixFunction · 0.85
iommu_remove_deviceFunction · 0.85
vm_iommu_domainFunction · 0.85

Tested by

no test coverage detected