Add macro to disable legacy vring functions.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -135,6 +135,8 @@ struct vring { · 134 unmodified lines | ||
| 135 | 135 | #define VRING_USED_ALIGN_SIZE 4 |
| 136 | 136 | #define VRING_DESC_ALIGN_SIZE 16 |
| 137 | 137 | |
| 138 | +#ifndef VIRTIO_RING_NO_LEGACY | |
| 139 | + | |
| 138 | 140 | /* The standard layout for the ring is a continuous chunk of memory which looks |
| 139 | 141 | * like this. We assume num is a power of 2. |
| 140 | 142 | * |
| @@ -181,6 +183,8 @@ static inline unsigned vring_size(unsigned int num, unsigned long align) · 40 unmodified lines | ||
| 181 | 183 | + sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num; |
| 182 | 184 | } |
| 183 | 185 | |
| 186 | +#endif /* VIRTIO_RING_NO_LEGACY */ | |
| 187 | + | |
| 184 | 188 | /* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */ |
| 185 | 189 | /* Assuming a given event_idx value from the other side, if |
| 186 | 190 | * we have just incremented index from old to new_idx, |