diff options
author | Avi Kivity <avi@redhat.com> | 2011-08-08 21:42:57 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-08-25 10:56:34 +0300 |
commit | 2b90ca040c59d73943061e49f39455964e8af158 (patch) | |
tree | 333f3d6b77abea19977f8e7185e44530880ea44e /hw | |
parent | fcb9fc24c48b5af86cf0c7f1ff3d44a1fad6c655 (diff) |
milkymist: convert to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/milkymist.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/milkymist.c b/hw/milkymist.c index 092d8b072b..ef21ccaba1 100644 --- a/hw/milkymist.c +++ b/hw/milkymist.c @@ -29,6 +29,7 @@ #include "blockdev.h" #include "milkymist-hw.h" #include "lm32.h" +#include "exec-memory.h" #define BIOS_FILENAME "mmone-bios.bin" #define BIOS_OFFSET 0x00860000 @@ -81,7 +82,8 @@ milkymist_init(ram_addr_t ram_size_not_used, CPUState *env; int kernel_size; DriveInfo *dinfo; - ram_addr_t phys_sdram; + MemoryRegion *address_space_mem = get_system_memory(); + MemoryRegion *phys_sdram = g_new(MemoryRegion, 1); MemoryRegion *phys_flash = g_new(MemoryRegion, 1); qemu_irq irq[32], *cpu_irq; int i; @@ -109,9 +111,8 @@ milkymist_init(ram_addr_t ram_size_not_used, cpu_lm32_set_phys_msb_ignore(env, 1); - phys_sdram = qemu_ram_alloc(NULL, "milkymist.sdram", sdram_size); - cpu_register_physical_memory(sdram_base, sdram_size, - phys_sdram | IO_MEM_RAM); + memory_region_init_ram(phys_sdram, NULL, "milkymist.sdram", sdram_size); + memory_region_add_subregion(address_space_mem, sdram_base, phys_sdram); memory_region_init_rom_device(phys_flash, &pflash_cfi01_ops_be, NULL, "milkymist.flash", flash_size); |