From 1a1562f5ea3da17d45d3829e35b5f49da9ec2db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 17 Jun 2013 04:09:11 +0200 Subject: cpu: Introduce VMSTATE_CPU() macro for CPUState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To be used to embed common CPU state into CPU subclasses. Reviewed-by: Juan Quintela Signed-off-by: Andreas Färber --- include/qom/cpu.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/qom/cpu.h') 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 -- cgit v1.2.3