virtio-pci.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Virtio PCI Bindings
  3. *
  4. * Copyright IBM, Corp. 2007
  5. * Copyright (c) 2009 CodeSourcery
  6. *
  7. * Authors:
  8. * Anthony Liguori <aliguori@us.ibm.com>
  9. * Paul Brook <paul@codesourcery.com>
  10. *
  11. * This work is licensed under the terms of the GNU GPL, version 2. See
  12. * the COPYING file in the top-level directory.
  13. */
  14. #ifndef QEMU_VIRTIO_PCI_H
  15. #define QEMU_VIRTIO_PCI_H
  16. #include "virtio-net.h"
  17. #include "virtio-serial.h"
  18. /* Performance improves when virtqueue kick processing is decoupled from the
  19. * vcpu thread using ioeventfd for some devices. */
  20. #define VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT 1
  21. #define VIRTIO_PCI_FLAG_USE_IOEVENTFD (1 << VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT)
  22. typedef struct {
  23. PCIDevice pci_dev;
  24. VirtIODevice *vdev;
  25. MemoryRegion bar;
  26. MemoryRegion msix_bar;
  27. uint32_t flags;
  28. uint32_t class_code;
  29. uint32_t nvectors;
  30. BlockConf block;
  31. char *block_serial;
  32. NICConf nic;
  33. uint32_t host_features;
  34. #ifdef CONFIG_LINUX
  35. V9fsConf fsconf;
  36. #endif
  37. virtio_serial_conf serial;
  38. virtio_net_conf net;
  39. bool ioeventfd_disabled;
  40. bool ioeventfd_started;
  41. } VirtIOPCIProxy;
  42. void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev);
  43. void virtio_pci_reset(DeviceState *d);
  44. /* Virtio ABI version, if we increment this, we break the guest driver. */
  45. #define VIRTIO_PCI_ABI_VERSION 0
  46. #endif