aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/pci.h
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2015-09-23 13:04:46 -0600
committerAlex Williamson <alex.williamson@redhat.com>2015-09-23 13:04:46 -0600
commit8c4f234853d9d438dc1733ca98674b1139a87c99 (patch)
treef7f9eb2c4bba660b288e059b1aa0aa370cd96da1 /hw/vfio/pci.h
parent056dfcb695cde3c62b7dc1d5ed6d2e38b3a73e29 (diff)
downloadqemu-8c4f234853d9d438dc1733ca98674b1139a87c99.zip
qemu-8c4f234853d9d438dc1733ca98674b1139a87c99.tar.gz
qemu-8c4f234853d9d438dc1733ca98674b1139a87c99.tar.bz2
vfio/pci: Foundation for new quirk structure
VFIOQuirk hosts a single memory region and a fixed set of data fields that try to handle all the quirk cases, but end up making those that don't exactly match really confusing. This patch introduces a struct intended to provide more flexibility and simpler code. VFIOQuirk is stripped to its basics, an opaque data pointer for quirk specific data and a pointer to an array of MemoryRegions with a counter. This still allows us to have common teardown routines, but adds much greater flexibility to support multiple memory regions and quirk specific data structures that are easier to maintain. The existing VFIOQuirk is transformed into VFIOLegacyQuirk, which further patches will eliminate entirely. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/vfio/pci.h')
-rw-r--r--hw/vfio/pci.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index f6dbe7f..8696976 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -22,10 +22,9 @@
struct VFIOPCIDevice;
-typedef struct VFIOQuirk {
- MemoryRegion mem;
+typedef struct VFIOLegacyQuirk {
struct VFIOPCIDevice *vdev;
- QLIST_ENTRY(VFIOQuirk) next;
+ MemoryRegion *mem;
struct {
uint32_t base_offset:TARGET_PAGE_BITS;
uint32_t address_offset:TARGET_PAGE_BITS;
@@ -43,6 +42,13 @@ typedef struct VFIOQuirk {
uint8_t read_flags;
uint8_t write_flags;
} data;
+} VFIOLegacyQuirk;
+
+typedef struct VFIOQuirk {
+ QLIST_ENTRY(VFIOQuirk) next;
+ void *data;
+ int nr_mem;
+ MemoryRegion *mem;
} VFIOQuirk;
typedef struct VFIOBAR {