1 /* 2 * libqos PCI bindings for PC 3 * 4 * Copyright IBM, Corp. 2012-2013 5 * 6 * Authors: 7 * Anthony Liguori <aliguori@us.ibm.com> 8 * 9 * This work is licensed under the terms of the GNU GPL, version 2 or later. 10 * See the COPYING file in the top-level directory. 11 */ 12 13 #ifndef LIBQOS_PCI_PC_H 14 #define LIBQOS_PCI_PC_H 15 16 #include "libqos/pci.h" 17 #include "libqos/malloc.h" 18 #include "libqos/qgraph.h" 19 20 typedef struct QPCIBusPC { 21 QOSGraphObject obj; 22 QPCIBus bus; 23 } QPCIBusPC; 24 25 /* qpci_init_pc(): 26 * @ret: A valid QPCIBusPC * pointer 27 * @qts: The %QTestState for this PC machine 28 * @alloc: A previously initialized @alloc providing memory for @qts 29 * 30 * This function initializes an already allocated 31 * QPCIBusPC object. 32 */ 33 void qpci_init_pc(QPCIBusPC *ret, QTestState *qts, QGuestAllocator *alloc); 34 35 /* qpci_pc_new(): 36 * @qts: The %QTestState for this PC machine 37 * @alloc: A previously initialized @alloc providing memory for @qts 38 * 39 * This function creates a new QPCIBusPC object, 40 * and properly initialize its fields. 41 * 42 * Returns the QPCIBus *bus field of a newly 43 * allocated QPCIBusPC. 44 */ 45 QPCIBus *qpci_new_pc(QTestState *qts, QGuestAllocator *alloc); 46 47 void qpci_free_pc(QPCIBus *bus); 48 49 #endif 50