Browse Source

[virtio] Renumber virtio_pci_region flags

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>
tags/v1.20.1
Ladi Prosek 8 years ago
parent
commit
fbbc895442
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/include/ipxe/virtio-pci.h

+ 3
- 3
src/include/ipxe/virtio-pci.h View File

@@ -107,11 +107,11 @@ struct virtio_pci_region {
107 107
 /* How to interpret the base field */
108 108
 #define VIRTIO_PCI_REGION_TYPE_MASK  0x00000003
109 109
 /* The base field is a memory address */
110
-#define VIRTIO_PCI_REGION_MEMORY     0x00000000
110
+#define VIRTIO_PCI_REGION_MEMORY     0x00000001
111 111
 /* The base field is a port address */
112
-#define VIRTIO_PCI_REGION_PORT       0x00000001
112
+#define VIRTIO_PCI_REGION_PORT       0x00000002
113 113
 /* The base field is an offset within the PCI bar */
114
-#define VIRTIO_PCI_REGION_PCI_CONFIG 0x00000002
114
+#define VIRTIO_PCI_REGION_PCI_CONFIG 0x00000003
115 115
     unsigned flags;
116 116
 };
117 117
 

Loading…
Cancel
Save