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