11cf4323eSThomas Huth /* 21cf4323eSThomas Huth * libqos PCI bindings for SPAPR 31cf4323eSThomas Huth * 41cf4323eSThomas Huth * This work is licensed under the terms of the GNU GPL, version 2 or later. 51cf4323eSThomas Huth * See the COPYING file in the top-level directory. 61cf4323eSThomas Huth */ 71cf4323eSThomas Huth 81cf4323eSThomas Huth #ifndef LIBQOS_PCI_SPAPR_H 91cf4323eSThomas Huth #define LIBQOS_PCI_SPAPR_H 101cf4323eSThomas Huth 11*b243c73cSXuzhou Cheng #include "libqos-malloc.h" 12a2ce7dbdSPaolo Bonzini #include "pci.h" 13a2ce7dbdSPaolo Bonzini #include "qgraph.h" 141cf4323eSThomas Huth 151cf4323eSThomas Huth /* From include/hw/pci-host/spapr.h */ 161cf4323eSThomas Huth 171cf4323eSThomas Huth typedef struct QPCIWindow { 181cf4323eSThomas Huth uint64_t pci_base; /* window address in PCI space */ 191cf4323eSThomas Huth uint64_t size; /* window size */ 201cf4323eSThomas Huth } QPCIWindow; 211cf4323eSThomas Huth 221cf4323eSThomas Huth typedef struct QPCIBusSPAPR { 231cf4323eSThomas Huth QOSGraphObject obj; 241cf4323eSThomas Huth QPCIBus bus; 251cf4323eSThomas Huth QGuestAllocator *alloc; 261cf4323eSThomas Huth 271cf4323eSThomas Huth uint64_t buid; 281cf4323eSThomas Huth 291cf4323eSThomas Huth uint64_t pio_cpu_base; 301cf4323eSThomas Huth QPCIWindow pio; 311cf4323eSThomas Huth 321cf4323eSThomas Huth uint64_t mmio32_cpu_base; 331cf4323eSThomas Huth QPCIWindow mmio32; 341cf4323eSThomas Huth } QPCIBusSPAPR; 351cf4323eSThomas Huth 361cf4323eSThomas Huth void qpci_init_spapr(QPCIBusSPAPR *ret, QTestState *qts, 371cf4323eSThomas Huth QGuestAllocator *alloc); 381cf4323eSThomas Huth QPCIBus *qpci_new_spapr(QTestState *qts, QGuestAllocator *alloc); 391cf4323eSThomas Huth void qpci_free_spapr(QPCIBus *bus); 401cf4323eSThomas Huth 411cf4323eSThomas Huth #endif 42