Skip to content

Commit

Permalink
[virtio] Renumber virtio_pci_region flags
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ladipro authored and mcb30 committed Jun 20, 2016
1 parent 25ae251 commit fbbc895
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/include/ipxe/virtio-pci.h
Expand Up @@ -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;
};

Expand Down

0 comments on commit fbbc895

Please sign in to comment.