2
0

iommu.h 758 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright © 2022 Oracle and/or its affiliates.
  3. *
  4. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  5. * See the COPYING file in the top-level directory.
  6. *
  7. */
  8. #ifndef REMOTE_IOMMU_H
  9. #define REMOTE_IOMMU_H
  10. #include "hw/pci/pci_bus.h"
  11. #include "hw/pci/pci.h"
  12. #ifndef INT2VOIDP
  13. #define INT2VOIDP(i) (void *)(uintptr_t)(i)
  14. #endif
  15. typedef struct RemoteIommuElem {
  16. MemoryRegion *mr;
  17. AddressSpace as;
  18. } RemoteIommuElem;
  19. #define TYPE_REMOTE_IOMMU "x-remote-iommu"
  20. OBJECT_DECLARE_SIMPLE_TYPE(RemoteIommu, REMOTE_IOMMU)
  21. struct RemoteIommu {
  22. Object parent;
  23. GHashTable *elem_by_devfn;
  24. QemuMutex lock;
  25. };
  26. void remote_iommu_setup(PCIBus *pci_bus);
  27. void remote_iommu_unplug_dev(PCIDevice *pci_dev);
  28. #endif