1
2
3
4
5
6
7
8#ifndef HW_MISC_UNIMP_H
9#define HW_MISC_UNIMP_H
10
11#include "hw/sysbus.h"
12
13#define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device"
14
15#define UNIMPLEMENTED_DEVICE(obj) \
16 OBJECT_CHECK(UnimplementedDeviceState, (obj), TYPE_UNIMPLEMENTED_DEVICE)
17
18typedef struct {
19 SysBusDevice parent_obj;
20 MemoryRegion iomem;
21 char *name;
22 uint64_t size;
23} UnimplementedDeviceState;
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38static inline void create_unimplemented_device(const char *name,
39 hwaddr base,
40 hwaddr size)
41{
42 DeviceState *dev = qdev_create(NULL, TYPE_UNIMPLEMENTED_DEVICE);
43
44 qdev_prop_set_string(dev, "name", name);
45 qdev_prop_set_uint64(dev, "size", size);
46 qdev_init_nofail(dev);
47
48 sysbus_mmio_map_overlap(SYS_BUS_DEVICE(dev), 0, base, -1000);
49}
50
51#endif
52