xref: /qemu/tests/qtest/libqos/pci-pc.h (revision 85af0057e7be4375e9563be5b6d064f963ec2c39)
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 
16c4efe1caSAnthony Liguori #include "libqos/pci.h"
172ecd7e2fSLaurent Vivier #include "libqos/malloc.h"
18*85af0057SEmanuele Giuseppe Esposito #include "libqos/qgraph.h"
19*85af0057SEmanuele Giuseppe Esposito 
20*85af0057SEmanuele Giuseppe Esposito typedef struct QPCIBusPC {
21*85af0057SEmanuele Giuseppe Esposito     QOSGraphObject obj;
22*85af0057SEmanuele Giuseppe Esposito     QPCIBus bus;
23*85af0057SEmanuele Giuseppe Esposito } QPCIBusPC;
24*85af0057SEmanuele Giuseppe Esposito 
25*85af0057SEmanuele Giuseppe Esposito /* qpci_init_pc():
26*85af0057SEmanuele Giuseppe Esposito  * @ret: A valid QPCIBusPC * pointer
27*85af0057SEmanuele Giuseppe Esposito  * @qts: The %QTestState for this PC machine
28*85af0057SEmanuele Giuseppe Esposito  * @alloc: A previously initialized @alloc providing memory for @qts
29*85af0057SEmanuele Giuseppe Esposito  *
30*85af0057SEmanuele Giuseppe Esposito  * This function initializes an already allocated
31*85af0057SEmanuele Giuseppe Esposito  * QPCIBusPC object.
32*85af0057SEmanuele Giuseppe Esposito  */
33*85af0057SEmanuele 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  *
42*85af0057SEmanuele Giuseppe Esposito  * Returns the QPCIBus *bus field of a newly
43*85af0057SEmanuele 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