]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[virtio] Renumber virtio_pci_region flags
authorLadi Prosek <lprosek@redhat.com>
Mon, 2 May 2016 11:46:39 +0000 (13:46 +0200)
committerMichael Brown <mcb30@ipxe.org>
Mon, 20 Jun 2016 13:20:21 +0000 (14:20 +0100)
Some of the regions may end up being unmapped, either because they are
optional or because the attempt to map them has failed.  Region types
starting at 0 didn't make it easy to test for this condition.

This commit bumps all valid region types up by 1 with 0 having the
implicit 'unmapped' meaning.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/virtio-pci.h

index c7452c82f4b412241607a5e2257f301a0691e280..f3c9b17ca0f35e030027f0c558b4fb58e5ae6041 100644 (file)
@@ -107,11 +107,11 @@ struct virtio_pci_region {
 /* How to interpret the base field */
 #define VIRTIO_PCI_REGION_TYPE_MASK  0x00000003
 /* The base field is a memory address */
-#define VIRTIO_PCI_REGION_MEMORY     0x00000000
+#define VIRTIO_PCI_REGION_MEMORY     0x00000001
 /* The base field is a port address */
-#define VIRTIO_PCI_REGION_PORT       0x00000001
+#define VIRTIO_PCI_REGION_PORT       0x00000002
 /* The base field is an offset within the PCI bar */
-#define VIRTIO_PCI_REGION_PCI_CONFIG 0x00000002
+#define VIRTIO_PCI_REGION_PCI_CONFIG 0x00000003
     unsigned flags;
 };