]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/misc/unimp: Move struct to header file
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 2 Mar 2018 10:45:38 +0000 (10:45 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 2 Mar 2018 11:03:45 +0000 (11:03 +0000)
Move the definition of the struct for the unimplemented-device
from unimp.c to unimp.h, so that users can embed the struct
in their own device structs if they prefer.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180220180325.29818-10-peter.maydell@linaro.org

hw/misc/unimp.c
include/hw/misc/unimp.h

index bcbb585888a8bb5454bf49e456ecc33388547cf7..1c0ba2f0a75221fa8b935f7406c09a84c99c4da3 100644 (file)
 #include "qemu/log.h"
 #include "qapi/error.h"
 
-#define UNIMPLEMENTED_DEVICE(obj) \
-    OBJECT_CHECK(UnimplementedDeviceState, (obj), TYPE_UNIMPLEMENTED_DEVICE)
-
-typedef struct {
-    SysBusDevice parent_obj;
-    MemoryRegion iomem;
-    char *name;
-    uint64_t size;
-} UnimplementedDeviceState;
-
 static uint64_t unimp_read(void *opaque, hwaddr offset, unsigned size)
 {
     UnimplementedDeviceState *s = UNIMPLEMENTED_DEVICE(opaque);
index 52e068ec3eda33a183e696cf5dc89f862df1f3ac..2a291ca42dd02a94c5bacde15d02468868a7bf6b 100644 (file)
 
 #define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device"
 
+#define UNIMPLEMENTED_DEVICE(obj) \
+    OBJECT_CHECK(UnimplementedDeviceState, (obj), TYPE_UNIMPLEMENTED_DEVICE)
+
+typedef struct {
+    SysBusDevice parent_obj;
+    MemoryRegion iomem;
+    char *name;
+    uint64_t size;
+} UnimplementedDeviceState;
+
 /**
  * create_unimplemented_device: create and map a dummy device
  * @name: name of the device for debug logging