Revision cfb0a50a

b/hw/pci.c
23 23
 */
24 24
#include "hw.h"
25 25
#include "pci.h"
26
#include "pci_internals.h"
26 27
#include "monitor.h"
27 28
#include "net.h"
28 29
#include "sysemu.h"
......
36 37
# define PCI_DPRINTF(format, ...)       do { } while (0)
37 38
#endif
38 39

  
39
struct PCIBus {
40
    BusState qbus;
41
    int devfn_min;
42
    pci_set_irq_fn set_irq;
43
    pci_map_irq_fn map_irq;
44
    pci_hotplug_fn hotplug;
45
    DeviceState *hotplug_qdev;
46
    void *irq_opaque;
47
    PCIDevice *devices[256];
48
    PCIDevice *parent_dev;
49
    target_phys_addr_t mem_base;
50

  
51
    QLIST_HEAD(, PCIBus) child; /* this will be replaced by qdev later */
52
    QLIST_ENTRY(PCIBus) sibling;/* this will be replaced by qdev later */
53

  
54
    /* The bus IRQ state is the logical OR of the connected devices.
55
       Keep a count of the number of devices with raised IRQs.  */
56
    int nirq;
57
    int *irq_count;
58
};
59

  
60 40
static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent);
61 41
static char *pcibus_get_dev_path(DeviceState *dev);
62 42

  
63
static struct BusInfo pci_bus_info = {
43
struct BusInfo pci_bus_info = {
64 44
    .name       = "PCI",
65 45
    .size       = sizeof(PCIBus),
66 46
    .print_dev  = pcibus_dev_print,
......
1533 1513
    return res;
1534 1514
}
1535 1515

  
1536
typedef struct {
1537
    PCIDevice dev;
1538
    PCIBus bus;
1539
    uint32_t vid;
1540
    uint32_t did;
1541
} PCIBridge;
1542

  
1543

  
1544 1516
static void pci_bridge_update_mappings_fn(PCIBus *b, PCIDevice *d)
1545 1517
{
1546 1518
    pci_update_mappings(d);
b/hw/pci_internals.h
1
#ifndef QEMU_PCI_INTERNALS_H
2
#define QEMU_PCI_INTERNALS_H
3

  
4
/*
5
 * This header files is private to pci.c and pci_bridge.c
6
 * So following structures are opaque to others and shouldn't be
7
 * accessed.
8
 */
9

  
10
extern struct BusInfo pci_bus_info;
11

  
12
struct PCIBus {
13
    BusState qbus;
14
    int devfn_min;
15
    pci_set_irq_fn set_irq;
16
    pci_map_irq_fn map_irq;
17
    pci_hotplug_fn hotplug;
18
    DeviceState *hotplug_qdev;
19
    void *irq_opaque;
20
    PCIDevice *devices[256];
21
    PCIDevice *parent_dev;
22
    target_phys_addr_t mem_base;
23

  
24
    QLIST_HEAD(, PCIBus) child; /* this will be replaced by qdev later */
25
    QLIST_ENTRY(PCIBus) sibling;/* this will be replaced by qdev later */
26

  
27
    /* The bus IRQ state is the logical OR of the connected devices.
28
       Keep a count of the number of devices with raised IRQs.  */
29
    int nirq;
30
    int *irq_count;
31
};
32

  
33
typedef struct {
34
    PCIDevice dev;
35
    PCIBus bus;
36
    uint32_t vid;
37
    uint32_t did;
38
} PCIBridge;
39

  
40
#endif /* QEMU_PCI_INTERNALS_H */

Also available in: Unified diff