aboutsummaryrefslogtreecommitdiff
path: root/hw/milkymist.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-08-08 21:42:57 +0300
committerAvi Kivity <avi@redhat.com>2011-09-04 17:46:52 +0300
commitc50a6def965d2e5144557af447825c9875f48a6f (patch)
treec48ed88fd5c475ee135c7230a668d96413577be3 /hw/milkymist.c
parent5105ed3b1931a8f61904b2c79af4dba364474dd2 (diff)
downloadqemu-c50a6def965d2e5144557af447825c9875f48a6f.zip
qemu-c50a6def965d2e5144557af447825c9875f48a6f.tar.gz
qemu-c50a6def965d2e5144557af447825c9875f48a6f.tar.bz2
milkymist: convert to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/milkymist.c')
-rw-r--r--hw/milkymist.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/milkymist.c b/hw/milkymist.c
index a44b80c..bca0a58 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);
qemu_irq irq[32], *cpu_irq;
int i;
char *bios_filename;
@@ -108,9 +110,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);
dinfo = drive_get(IF_PFLASH, 0, 0);
/* Numonyx JS28F256J3F105 */