summaryrefslogtreecommitdiff
path: root/hw/virtio.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-03-17 13:08:02 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-04-01 13:56:43 -0500
commit1cbdabe203164433fbbec3a1815d8be42a085c88 (patch)
treeb89555396c3e133b455c839451f8951ba015db60 /hw/virtio.h
parent2292b33986de9e2ac10b2674f85722bdfbc977d5 (diff)
downloadqemu-1cbdabe203164433fbbec3a1815d8be42a085c88.tar.gz
qemu-1cbdabe203164433fbbec3a1815d8be42a085c88.tar.bz2
qemu-1cbdabe203164433fbbec3a1815d8be42a085c88.zip
virtio: notifier support + APIs for queue fields
vhost needs physical addresses for ring and other queue fields, so add APIs for these. In particular, add binding API to set host/guest notifiers. Will be used by vhost. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio.h')
-rw-r--r--hw/virtio.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/hw/virtio.h b/hw/virtio.h
index 3baa2a34da..d0155e2761 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -19,6 +19,7 @@
#include "qdev.h"
#include "sysemu.h"
#include "block_int.h"
+#include "event_notifier.h"
/* from Linux's linux/virtio_config.h */
@@ -89,6 +90,8 @@ typedef struct {
int (*load_config)(void * opaque, QEMUFile *f);
int (*load_queue)(void * opaque, int n, QEMUFile *f);
unsigned (*get_features)(void * opaque);
+ int (*set_guest_notifier)(void * opaque, int n, bool assigned);
+ int (*set_host_notifier)(void * opaque, int n, bool assigned);
} VirtIOBindings;
#define VIRTIO_PCI_QUEUE_MAX 64
@@ -181,5 +184,18 @@ void virtio_net_exit(VirtIODevice *vdev);
DEFINE_PROP_BIT("indirect_desc", _state, _field, \
VIRTIO_RING_F_INDIRECT_DESC, true)
-
+target_phys_addr_t virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
+target_phys_addr_t virtio_queue_get_avail_addr(VirtIODevice *vdev, int n);
+target_phys_addr_t virtio_queue_get_used_addr(VirtIODevice *vdev, int n);
+target_phys_addr_t virtio_queue_get_ring_addr(VirtIODevice *vdev, int n);
+target_phys_addr_t virtio_queue_get_desc_size(VirtIODevice *vdev, int n);
+target_phys_addr_t virtio_queue_get_avail_size(VirtIODevice *vdev, int n);
+target_phys_addr_t virtio_queue_get_used_size(VirtIODevice *vdev, int n);
+target_phys_addr_t virtio_queue_get_ring_size(VirtIODevice *vdev, int n);
+uint16_t virtio_queue_get_last_avail_idx(VirtIODevice *vdev, int n);
+void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx);
+VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n);
+EventNotifier *virtio_queue_get_guest_notifier(VirtQueue *vq);
+EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq);
+void virtio_irq(VirtQueue *vq);
#endif