summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio_std.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/devices/virtio/virtio_std.h')
-rw-r--r--src/vnet/devices/virtio/virtio_std.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/vnet/devices/virtio/virtio_std.h b/src/vnet/devices/virtio/virtio_std.h
index 98befb5c820..619dd66d5ed 100644
--- a/src/vnet/devices/virtio/virtio_std.h
+++ b/src/vnet/devices/virtio/virtio_std.h
@@ -77,9 +77,17 @@ typedef enum
#define VRING_DESC_F_AVAIL (1 << 7)
#define VRING_DESC_F_USED (1 << 15)
-#define VRING_EVENT_F_ENABLE 0x0
-#define VRING_EVENT_F_DISABLE 0x1
-#define VRING_EVENT_F_DESC 0x2
+#define foreach_virtio_event_idx_flags \
+ _ (VRING_EVENT_F_ENABLE, 0) \
+ _ (VRING_EVENT_F_DISABLE, 1) \
+ _ (VRING_EVENT_F_DESC, 2)
+
+typedef enum
+{
+#define _(f,n) f = n,
+ foreach_virtio_event_idx_flags
+#undef _
+} virtio_event_idx_flags_t;
#define VRING_USED_F_NO_NOTIFY 1
#define VRING_AVAIL_F_NO_INTERRUPT 1