diff options
author | Emanuele Giuseppe Esposito | 2018-07-10 16:09:26 +0200 |
---|---|---|
committer | Paolo Bonzini | 2019-03-07 17:28:25 +0100 |
commit | b8782d2a47891a5f627f794f56d276ae69ece79e (patch) | |
tree | e2c8ee25fa12a1bd19d5405a6aa1f9375bdd6766 /tests/libqos/pci-spapr.h | |
parent | tests/qgraph: add generic PCI testcases (diff) | |
download | qemu-b8782d2a47891a5f627f794f56d276ae69ece79e.tar.gz qemu-b8782d2a47891a5f627f794f56d276ae69ece79e.tar.xz qemu-b8782d2a47891a5f627f794f56d276ae69ece79e.zip |
tests/libqos: pci-spapr driver and interface nodes
Add pci-bus-spapr node, that produces pci-bus. Move QPCIBusSPAPR struct
declaration in its header (since it will be needed by other drivers)
and introduce a setter method for drivers that do not need to allocate
but have to initialize QPCIBusSPAPR.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/libqos/pci-spapr.h')
-rw-r--r-- | tests/libqos/pci-spapr.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/libqos/pci-spapr.h b/tests/libqos/pci-spapr.h index 177e8c002c..d9e25631c6 100644 --- a/tests/libqos/pci-spapr.h +++ b/tests/libqos/pci-spapr.h @@ -10,7 +10,31 @@ #include "libqos/malloc.h" #include "libqos/pci.h" +#include "libqos/qgraph.h" +/* From include/hw/pci-host/spapr.h */ + +typedef struct QPCIWindow { + uint64_t pci_base; /* window address in PCI space */ + uint64_t size; /* window size */ +} QPCIWindow; + +typedef struct QPCIBusSPAPR { + QOSGraphObject obj; + QPCIBus bus; + QGuestAllocator *alloc; + + uint64_t buid; + + uint64_t pio_cpu_base; + QPCIWindow pio; + + uint64_t mmio32_cpu_base; + QPCIWindow mmio32; +} QPCIBusSPAPR; + +void qpci_init_spapr(QPCIBusSPAPR *ret, QTestState *qts, + QGuestAllocator *alloc); QPCIBus *qpci_new_spapr(QTestState *qts, QGuestAllocator *alloc); void qpci_free_spapr(QPCIBus *bus); |