Patchwork [17/24] dummy_m68k: convert to memory API

login
register
mail settings
Submitter Avi Kivity
Date Aug. 24, 2011, 10:11 a.m.
Message ID <1314180683-8227-18-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/111324/
State New
Headers show

Comments

Avi Kivity - Aug. 24, 2011, 10:11 a.m.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/dummy_m68k.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/dummy_m68k.c b/hw/dummy_m68k.c
index 2de69ad..609d04c 100644
--- a/hw/dummy_m68k.c
+++ b/hw/dummy_m68k.c
@@ -6,6 +6,7 @@ 
  * This code is licensed under the GPL
  */
 
+#include <glib.h>
 #include "hw.h"
 #include "boards.h"
 #include "loader.h"
@@ -23,6 +24,7 @@  static void dummy_m68k_init(MemoryRegion *address_space_mem,
                      const char *initrd_filename, const char *cpu_model)
 {
     CPUState *env;
+    MemoryRegion *ram = g_new(MemoryRegion, 1);
     int kernel_size;
     uint64_t elf_entry;
     target_phys_addr_t entry;
@@ -39,8 +41,8 @@  static void dummy_m68k_init(MemoryRegion *address_space_mem,
     env->vbr = 0;
 
     /* RAM at address zero */
-    cpu_register_physical_memory(0, ram_size,
-        qemu_ram_alloc(NULL, "dummy_m68k.ram", ram_size) | IO_MEM_RAM);
+    memory_region_init_ram(ram, NULL, "dummy_m68k.ram", ram_size);
+    memory_region_add_subregion(address_space_mem, 0, ram);
 
     /* Load kernel.  */
     if (kernel_filename) {