2 * "Unimplemented" device
4 * Copyright Linaro Limited, 2017
5 * Written by Peter Maydell
8 #ifndef HW_MISC_UNIMP_H
9 #define HW_MISC_UNIMP_H
11 #include "hw/qdev-properties.h"
12 #include "hw/sysbus.h"
13 #include "qapi/error.h"
14 #include "qom/object.h"
16 #define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device"
18 OBJECT_DECLARE_SIMPLE_TYPE(UnimplementedDeviceState
, UNIMPLEMENTED_DEVICE
)
20 struct UnimplementedDeviceState
{
21 SysBusDevice parent_obj
;
23 unsigned offset_fmt_width
;
29 * create_unimplemented_device: create and map a dummy device
30 * @name: name of the device for debug logging
31 * @base: base address of the device's MMIO region
32 * @size: size of the device's MMIO region
34 * This utility function creates and maps an instance of unimplemented-device,
35 * which is a dummy device which simply logs all guest accesses to
36 * it via the qemu_log LOG_UNIMP debug log.
37 * The device is mapped at priority -1000, which means that you can
38 * use it to cover a large region and then map other devices on top of it
41 static inline void create_unimplemented_device(const char *name
,
45 DeviceState
*dev
= qdev_new(TYPE_UNIMPLEMENTED_DEVICE
);
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
);
51 sysbus_mmio_map_overlap(SYS_BUS_DEVICE(dev
), 0, base
, -1000);