]> git.ipfire.org Git - thirdparty/qemu.git/blame - include/hw/pci-host/gpex.h
Move QOM typedefs and add missing includes
[thirdparty/qemu.git] / include / hw / pci-host / gpex.h
CommitLineData
4d8fde11
AG
1/*
2 * QEMU Generic PCI Express Bridge Emulation
3 *
4 * Copyright (C) 2015 Alexander Graf <agraf@suse.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
e361a772
TH
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>
4d8fde11
AG
18 */
19
20#ifndef HW_GPEX_H
21#define HW_GPEX_H
22
4d8fde11
AG
23#include "hw/sysbus.h"
24#include "hw/pci/pci.h"
25#include "hw/pci/pcie_host.h"
db1015e9 26#include "qom/object.h"
4d8fde11
AG
27
28#define TYPE_GPEX_HOST "gpex-pcihost"
db1015e9 29typedef struct GPEXHost GPEXHost;
4d8fde11
AG
30#define GPEX_HOST(obj) \
31 OBJECT_CHECK(GPEXHost, (obj), TYPE_GPEX_HOST)
32
33#define TYPE_GPEX_ROOT_DEVICE "gpex-root"
db1015e9 34typedef struct GPEXRootState GPEXRootState;
4d8fde11
AG
35#define MCH_PCI_DEVICE(obj) \
36 OBJECT_CHECK(GPEXRootState, (obj), TYPE_GPEX_ROOT_DEVICE)
37
38#define GPEX_NUM_IRQS 4
39
db1015e9 40struct GPEXRootState {
4d8fde11
AG
41 /*< private >*/
42 PCIDevice parent_obj;
43 /*< public >*/
db1015e9 44};
4d8fde11 45
db1015e9 46struct GPEXHost {
4d8fde11
AG
47 /*< private >*/
48 PCIExpressHost parent_obj;
49 /*< public >*/
50
51 GPEXRootState gpex_root;
52
53 MemoryRegion io_ioport;
54 MemoryRegion io_mmio;
55 qemu_irq irq[GPEX_NUM_IRQS];
70bfdce6 56 int irq_num[GPEX_NUM_IRQS];
db1015e9 57};
4d8fde11 58
70bfdce6
PS
59int gpex_set_irq_num(GPEXHost *s, int index, int gsi);
60
4d8fde11 61#endif /* HW_GPEX_H */