History

virtio_pci: macros for PCI layout offsets

QEMU wants it, so why not? Trust, but verify.

Rusty Russell committed 13 years ago

Commit 89461c41 parent 1fcf0512 files · +90 −6Browse files

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

Unified · Split

include/uapi/linux/virtio_pci.h+31−5
@@ -124,11 +124,6 @@ struct virtio_pci_cap { · 123 unmodified lines
124 __le32 length; /* Length of the structure, in bytes. */124 __le32 length; /* Length of the structure, in bytes. */
125};125};
126 126
127#define VIRTIO_PCI_CAP_BAR_SHIFT 5
128#define VIRTIO_PCI_CAP_BAR_MASK 0x7
129#define VIRTIO_PCI_CAP_TYPE_SHIFT 0
130#define VIRTIO_PCI_CAP_TYPE_MASK 0x7
131
132struct virtio_pci_notify_cap {127struct virtio_pci_notify_cap {
133 struct virtio_pci_cap cap;128 struct virtio_pci_cap cap;
134 __le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */129 __le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */
@@ -160,6 +155,37 @@ struct virtio_pci_common_cfg { · 25 unmodified lines
160 __le32 queue_used_hi; /* read-write */155 __le32 queue_used_hi; /* read-write */
161};156};
162 157
158/* Macro versions of offsets for the Old Timers! */
159#define VIRTIO_PCI_CAP_VNDR 0
160#define VIRTIO_PCI_CAP_NEXT 1
161#define VIRTIO_PCI_CAP_LEN 2
162#define VIRTIO_PCI_CAP_CFG_TYPE 3
163#define VIRTIO_PCI_CAP_BAR 4
164#define VIRTIO_PCI_CAP_OFFSET 8
165#define VIRTIO_PCI_CAP_LENGTH 12
166
167#define VIRTIO_PCI_NOTIFY_CAP_MULT 16
168
169#define VIRTIO_PCI_COMMON_DFSELECT 0
170#define VIRTIO_PCI_COMMON_DF 4
171#define VIRTIO_PCI_COMMON_GFSELECT 8
172#define VIRTIO_PCI_COMMON_GF 12
173#define VIRTIO_PCI_COMMON_MSIX 16
174#define VIRTIO_PCI_COMMON_NUMQ 18
175#define VIRTIO_PCI_COMMON_STATUS 20
176#define VIRTIO_PCI_COMMON_CFGGENERATION 21
177#define VIRTIO_PCI_COMMON_Q_SELECT 22
178#define VIRTIO_PCI_COMMON_Q_SIZE 24
179#define VIRTIO_PCI_COMMON_Q_MSIX 26
180#define VIRTIO_PCI_COMMON_Q_ENABLE 28
181#define VIRTIO_PCI_COMMON_Q_NOFF 30
182#define VIRTIO_PCI_COMMON_Q_DESCLO 32
183#define VIRTIO_PCI_COMMON_Q_DESCHI 36
184#define VIRTIO_PCI_COMMON_Q_AVAILLO 40
185#define VIRTIO_PCI_COMMON_Q_AVAILHI 44
186#define VIRTIO_PCI_COMMON_Q_USEDLO 48
187#define VIRTIO_PCI_COMMON_Q_USEDHI 52
188
163#endif /* VIRTIO_PCI_NO_MODERN */189#endif /* VIRTIO_PCI_NO_MODERN */
164 190
165#endif191#endif