2
0

iohub.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * IO Hub for remote device
  3. *
  4. * Copyright © 2018, 2021 Oracle and/or its affiliates.
  5. *
  6. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  7. * See the COPYING file in the top-level directory.
  8. *
  9. */
  10. #ifndef REMOTE_IOHUB_H
  11. #define REMOTE_IOHUB_H
  12. #include "hw/pci/pci_device.h"
  13. #include "qemu/event_notifier.h"
  14. #include "qemu/thread-posix.h"
  15. #include "hw/remote/mpqemu-link.h"
  16. #define REMOTE_IOHUB_NB_PIRQS PCI_DEVFN_MAX
  17. typedef struct ResampleToken {
  18. void *iohub;
  19. int pirq;
  20. } ResampleToken;
  21. typedef struct RemoteIOHubState {
  22. PCIDevice d;
  23. EventNotifier irqfds[REMOTE_IOHUB_NB_PIRQS];
  24. EventNotifier resamplefds[REMOTE_IOHUB_NB_PIRQS];
  25. unsigned int irq_level[REMOTE_IOHUB_NB_PIRQS];
  26. ResampleToken token[REMOTE_IOHUB_NB_PIRQS];
  27. QemuMutex irq_level_lock[REMOTE_IOHUB_NB_PIRQS];
  28. } RemoteIOHubState;
  29. int remote_iohub_map_irq(PCIDevice *pci_dev, int intx);
  30. void remote_iohub_set_irq(void *opaque, int pirq, int level);
  31. void process_set_irqfd_msg(PCIDevice *pci_dev, MPQemuMsg *msg);
  32. void remote_iohub_init(RemoteIOHubState *iohub);
  33. #endif