mirror of https://github.com/xqemu/xqemu.git
hw/misc/unimp: Move struct to header file
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
This commit is contained in:
parent
c7b26382fe
commit
a7bc4ee528
|
@ -18,16 +18,6 @@
|
|||
#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);
|
||||
|
|
|
@ -12,6 +12,16 @@
|
|||
|
||||
#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
|
||||
|
|
Loading…
Reference in New Issue