1#ifndef HW_PLATFORM_BUS_H
2#define HW_PLATFORM_BUS_H 1
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#include "hw/sysbus.h"
26
27typedef struct PlatformBusDevice PlatformBusDevice;
28
29#define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device"
30#define PLATFORM_BUS_DEVICE(obj) \
31 OBJECT_CHECK(PlatformBusDevice, (obj), TYPE_PLATFORM_BUS_DEVICE)
32#define PLATFORM_BUS_DEVICE_CLASS(klass) \
33 OBJECT_CLASS_CHECK(PlatformBusDeviceClass, (klass), TYPE_PLATFORM_BUS_DEVICE)
34#define PLATFORM_BUS_DEVICE_GET_CLASS(obj) \
35 OBJECT_GET_CLASS(PlatformBusDeviceClass, (obj), TYPE_PLATFORM_BUS_DEVICE)
36
37struct PlatformBusDevice {
38
39 SysBusDevice parent_obj;
40 Notifier notifier;
41 bool done_gathering;
42
43
44 uint32_t mmio_size;
45 MemoryRegion mmio;
46
47 uint32_t num_irqs;
48 qemu_irq *irqs;
49 unsigned long *used_irqs;
50};
51
52int platform_bus_get_irqn(PlatformBusDevice *platform_bus, SysBusDevice *sbdev,
53 int n);
54hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,
55 int n);
56
57#endif
58