aboutsummaryrefslogtreecommitdiffstats
path: root/hw/omap1.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-12-20 15:59:12 +0200
committerAvi Kivity <avi@redhat.com>2012-01-04 13:34:48 +0200
commitc5705a7728b4a6bc9e4f2d35911adbaf28042b25 (patch)
treee96a1e0c9fbd0fa3624b5454038659775c81fba2 /hw/omap1.c
parent8991c79b57b75fcdeb290df89b9b0adaccb0303c (diff)
vmstate, memory: decouple vmstate from memory API
Currently creating a memory region automatically registers it for live migration. This differs from other state (which is enumerated in a VMStateDescription structure) and ties the live migration code into the memory core. Decouple the two by introducing a separate API, vmstate_register_ram(), for registering a RAM block for migration. Currently the same implementation is reused, but later it can be moved into a separate list, and registrations can be moved to VMStateDescription blocks. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/omap1.c')
-rw-r--r--hw/omap1.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/omap1.c b/hw/omap1.c
index 53cde7611..590ceb512 100644
--- a/hw/omap1.c
+++ b/hw/omap1.c
@@ -3819,9 +3819,11 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory,
omap_clk_init(s);
/* Memory-mapped stuff */
- memory_region_init_ram(&s->emiff_ram, NULL, "omap1.dram", s->sdram_size);
+ memory_region_init_ram(&s->emiff_ram, "omap1.dram", s->sdram_size);
+ vmstate_register_ram_global(&s->emiff_ram);
memory_region_add_subregion(system_memory, OMAP_EMIFF_BASE, &s->emiff_ram);
- memory_region_init_ram(&s->imif_ram, NULL, "omap1.sram", s->sram_size);
+ memory_region_init_ram(&s->imif_ram, "omap1.sram", s->sram_size);
+ vmstate_register_ram_global(&s->imif_ram);
memory_region_add_subregion(system_memory, OMAP_IMIF_BASE, &s->imif_ram);
omap_clkm_init(system_memory, 0xfffece00, 0xe1008000, s);