History

virtio: add VIRTIO_RING_NO_LEGACY

Add macro to disable legacy vring functions.

Matej Genci committed 7 years ago

Commit e7c8cc31 parent 3d77e6a2 files · +5 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/virtio_ring.h+4−0
@@ -135,6 +135,8 @@ struct vring { · 134 unmodified lines
135135 #define VRING_USED_ALIGN_SIZE 4
136136 #define VRING_DESC_ALIGN_SIZE 16
137137
138+#ifndef VIRTIO_RING_NO_LEGACY
139+
138140 /* The standard layout for the ring is a continuous chunk of memory which looks
139141 * like this. We assume num is a power of 2.
140142 *
@@ -181,6 +183,8 @@ static inline unsigned vring_size(unsigned int num, unsigned long align) · 40 unmodified lines
181183 + sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num;
182184 }
183185
186+#endif /* VIRTIO_RING_NO_LEGACY */
187+
184188 /* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
185189 /* Assuming a given event_idx value from the other side, if
186190 * we have just incremented index from old to new_idx,