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

Function ppt_assign_device

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

Source from the content-addressed store, hash-verified

381}
382
383int
384ppt_assign_device(struct vm *vm, int bus, int slot, int func)
385{
386 struct pptdev *ppt;
387 int error;
388
389 /* Passing NULL requires the device to be unowned. */
390 error = ppt_find(NULL, bus, slot, func, &ppt);
391 if (error)
392 return (error);
393
394 pci_save_state(ppt->dev);
395 ppt_pci_reset(ppt->dev);
396 pci_restore_state(ppt->dev);
397 ppt->vm = vm;
398 iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev));
399 return (0);
400}
401
402int
403ppt_unassign_device(struct vm *vm, int bus, int slot, int func)

Callers 1

vm_assign_pptdevFunction · 0.85

Calls 4

ppt_findFunction · 0.85
ppt_pci_resetFunction · 0.85
iommu_add_deviceFunction · 0.85
vm_iommu_domainFunction · 0.85

Tested by

no test coverage detected