1#ifndef HW_PLATFORM_BUS_H
2#define HW_PLATFORM_BUS_H
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
41
42 uint32_t mmio_size;
43 MemoryRegion mmio;
44
45 uint32_t num_irqs;
46 qemu_irq *irqs;
47 unsigned long *used_irqs;
48};
49
50int platform_bus_get_irqn(PlatformBusDevice *platform_bus, SysBusDevice *sbdev,
51 int n);
52hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,
53 int n);
54
55void platform_bus_link_device(PlatformBusDevice *pbus, SysBusDevice *sbdev);
56
57#endif
58