diff options
author | Andreas Färber | 2013-06-17 04:09:11 +0200 |
---|---|---|
committer | Andreas Färber | 2013-06-28 13:25:11 +0200 |
commit | 1a1562f5ea3da17d45d3829e35b5f49da9ec2db5 (patch) | |
tree | f7da6aa385bc31f11e300cb8e9ca3507b2068328 /include/qom | |
parent | cpu: Introduce device_class_set_vmsd() helper (diff) | |
download | qemu-1a1562f5ea3da17d45d3829e35b5f49da9ec2db5.tar.gz qemu-1a1562f5ea3da17d45d3829e35b5f49da9ec2db5.tar.xz qemu-1a1562f5ea3da17d45d3829e35b5f49da9ec2db5.zip |
cpu: Introduce VMSTATE_CPU() macro for CPUState
To be used to embed common CPU state into CPU subclasses.
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/qom')
-rw-r--r-- | include/qom/cpu.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 397219b560..3e8cc479bd 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -378,4 +378,18 @@ void cpu_reset_interrupt(CPUState *cpu, int mask); */ 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 |