1c4efe1caSAnthony Liguori /* 2c4efe1caSAnthony Liguori * libqos PCI bindings for PC 3c4efe1caSAnthony Liguori * 4c4efe1caSAnthony Liguori * Copyright IBM, Corp. 2012-2013 5c4efe1caSAnthony Liguori * 6c4efe1caSAnthony Liguori * Authors: 7c4efe1caSAnthony Liguori * Anthony Liguori <aliguori@us.ibm.com> 8c4efe1caSAnthony Liguori * 9c4efe1caSAnthony Liguori * This work is licensed under the terms of the GNU GPL, version 2 or later. 10c4efe1caSAnthony Liguori * See the COPYING file in the top-level directory. 11c4efe1caSAnthony Liguori */ 12c4efe1caSAnthony Liguori 13c4efe1caSAnthony Liguori #ifndef LIBQOS_PCI_PC_H 14c4efe1caSAnthony Liguori #define LIBQOS_PCI_PC_H 15c4efe1caSAnthony Liguori 16a2ce7dbdSPaolo Bonzini #include "pci.h" 17*b243c73cSXuzhou Cheng #include "libqos-malloc.h" 18a2ce7dbdSPaolo Bonzini #include "qgraph.h" 1985af0057SEmanuele Giuseppe Esposito 2085af0057SEmanuele Giuseppe Esposito typedef struct QPCIBusPC { 2185af0057SEmanuele Giuseppe Esposito QOSGraphObject obj; 2285af0057SEmanuele Giuseppe Esposito QPCIBus bus; 2385af0057SEmanuele Giuseppe Esposito } QPCIBusPC; 2485af0057SEmanuele Giuseppe Esposito 2585af0057SEmanuele Giuseppe Esposito /* qpci_init_pc(): 2685af0057SEmanuele Giuseppe Esposito * @ret: A valid QPCIBusPC * pointer 2785af0057SEmanuele Giuseppe Esposito * @qts: The %QTestState for this PC machine 2885af0057SEmanuele Giuseppe Esposito * @alloc: A previously initialized @alloc providing memory for @qts 2985af0057SEmanuele Giuseppe Esposito * 3085af0057SEmanuele Giuseppe Esposito * This function initializes an already allocated 3185af0057SEmanuele Giuseppe Esposito * QPCIBusPC object. 3285af0057SEmanuele Giuseppe Esposito */ 3385af0057SEmanuele Giuseppe Esposito void qpci_init_pc(QPCIBusPC *ret, QTestState *qts, QGuestAllocator *alloc); 34c4efe1caSAnthony Liguori 35143e6db6SEmanuele Giuseppe Esposito /* qpci_pc_new(): 36143e6db6SEmanuele Giuseppe Esposito * @qts: The %QTestState for this PC machine 37143e6db6SEmanuele Giuseppe Esposito * @alloc: A previously initialized @alloc providing memory for @qts 38143e6db6SEmanuele Giuseppe Esposito * 39143e6db6SEmanuele Giuseppe Esposito * This function creates a new QPCIBusPC object, 40143e6db6SEmanuele Giuseppe Esposito * and properly initialize its fields. 41143e6db6SEmanuele Giuseppe Esposito * 4285af0057SEmanuele Giuseppe Esposito * Returns the QPCIBus *bus field of a newly 4385af0057SEmanuele Giuseppe Esposito * allocated QPCIBusPC. 44143e6db6SEmanuele Giuseppe Esposito */ 45143e6db6SEmanuele Giuseppe Esposito QPCIBus *qpci_new_pc(QTestState *qts, QGuestAllocator *alloc); 46143e6db6SEmanuele Giuseppe Esposito 477f2a5ae6SJohn Snow void qpci_free_pc(QPCIBus *bus); 48c4efe1caSAnthony Liguori 49c4efe1caSAnthony Liguori #endif 50