xref: /openbmc/qemu/tests/qtest/libqos/pci-spapr.h (revision d2dfe0b5)
1 /*
2  * libqos PCI bindings for SPAPR
3  *
4  * This work is licensed under the terms of the GNU GPL, version 2 or later.
5  * See the COPYING file in the top-level directory.
6  */
7 
8 #ifndef LIBQOS_PCI_SPAPR_H
9 #define LIBQOS_PCI_SPAPR_H
10 
11 #include "libqos-malloc.h"
12 #include "pci.h"
13 #include "qgraph.h"
14 
15 /* From include/hw/pci-host/spapr.h */
16 
17 typedef struct QPCIWindow {
18     uint64_t pci_base;    /* window address in PCI space */
19     uint64_t size;        /* window size */
20 } QPCIWindow;
21 
22 typedef struct QPCIBusSPAPR {
23     QOSGraphObject obj;
24     QPCIBus bus;
25     QGuestAllocator *alloc;
26 
27     uint64_t buid;
28 
29     uint64_t pio_cpu_base;
30     QPCIWindow pio;
31 
32     uint64_t mmio32_cpu_base;
33     QPCIWindow mmio32;
34 } QPCIBusSPAPR;
35 
36 void qpci_init_spapr(QPCIBusSPAPR *ret, QTestState *qts,
37                      QGuestAllocator *alloc);
38 QPCIBus *qpci_new_spapr(QTestState *qts, QGuestAllocator *alloc);
39 void     qpci_free_spapr(QPCIBus *bus);
40 
41 #endif
42