提交 1a1562f5 编写于 作者: A Andreas Färber

cpu: Introduce VMSTATE_CPU() macro for CPUState

To be used to embed common CPU state into CPU subclasses.
Reviewed-by: NJuan Quintela <quintela@redhat.com>
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 19e3835c
...@@ -330,7 +330,7 @@ static int cpu_common_post_load(void *opaque, int version_id) ...@@ -330,7 +330,7 @@ static int cpu_common_post_load(void *opaque, int version_id)
return 0; return 0;
} }
static const VMStateDescription vmstate_cpu_common = { const VMStateDescription vmstate_cpu_common = {
.name = "cpu_common", .name = "cpu_common",
.version_id = 1, .version_id = 1,
.minimum_version_id = 1, .minimum_version_id = 1,
...@@ -342,8 +342,7 @@ static const VMStateDescription vmstate_cpu_common = { ...@@ -342,8 +342,7 @@ static const VMStateDescription vmstate_cpu_common = {
VMSTATE_END_OF_LIST() VMSTATE_END_OF_LIST()
} }
}; };
#else
#define vmstate_cpu_common vmstate_dummy
#endif #endif
CPUState *qemu_get_cpu(int index) CPUState *qemu_get_cpu(int index)
......
...@@ -378,4 +378,18 @@ void cpu_reset_interrupt(CPUState *cpu, int mask); ...@@ -378,4 +378,18 @@ void cpu_reset_interrupt(CPUState *cpu, int mask);
*/ */
void cpu_resume(CPUState *cpu); void cpu_resume(CPUState *cpu);
#ifdef CONFIG_SOFTMMU
extern const struct VMStateDescription vmstate_cpu_common;
#else
#define vmstate_cpu_common vmstate_dummy
#endif
#define VMSTATE_CPU() { \
.name = "parent_obj", \
.size = sizeof(CPUState), \
.vmsd = &vmstate_cpu_common, \
.flags = VMS_STRUCT, \
.offset = 0, \
}
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册