qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 19/24] lm32_boards: convert to memory API


From: Avi Kivity
Subject: [Qemu-devel] [PATCH 19/24] lm32_boards: convert to memory API
Date: Wed, 24 Aug 2011 13:11:18 +0300

Signed-off-by: Avi Kivity <address@hidden>
---
 hw/lm32_boards.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/hw/lm32_boards.c b/hw/lm32_boards.c
index 3c6b5af..0a9ad59 100644
--- a/hw/lm32_boards.c
+++ b/hw/lm32_boards.c
@@ -79,7 +79,7 @@ static void lm32_evr_init(MemoryRegion *address_space_mem,
 {
     CPUState *env;
     DriveInfo *dinfo;
-    ram_addr_t phys_ram;
+    MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
     MemoryRegion *phys_flash = g_new(MemoryRegion, 1);
     qemu_irq *cpu_irq, irq[32];
     ResetInfo *reset_info;
@@ -108,8 +108,8 @@ static void lm32_evr_init(MemoryRegion *address_space_mem,
 
     reset_info->flash_base = flash_base;
 
-    phys_ram = qemu_ram_alloc(NULL, "lm32_evr.sdram", ram_size);
-    cpu_register_physical_memory(ram_base, ram_size, phys_ram | IO_MEM_RAM);
+    memory_region_init_ram(phys_ram, NULL, "lm32_evr.sdram", ram_size);
+    memory_region_add_subregion(address_space_mem, ram_base, phys_ram);
 
     memory_region_init_rom_device(phys_flash, &pflash_cfi02_ops_be,
                                   NULL, "lm32_evr.flash", flash_size);
@@ -170,7 +170,7 @@ static void lm32_uclinux_init(MemoryRegion 
*address_space_mem,
 {
     CPUState *env;
     DriveInfo *dinfo;
-    ram_addr_t phys_ram;
+    MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
     MemoryRegion *phys_flash = g_new(MemoryRegion, 1);
     qemu_irq *cpu_irq, irq[32];
     HWSetup *hw;
@@ -206,8 +206,8 @@ static void lm32_uclinux_init(MemoryRegion 
*address_space_mem,
 
     reset_info->flash_base = flash_base;
 
-    phys_ram = qemu_ram_alloc(NULL, "lm32_uclinux.sdram", ram_size);
-    cpu_register_physical_memory(ram_base, ram_size, phys_ram | IO_MEM_RAM);
+    memory_region_init_ram(phys_ram, NULL, "lm32_uclinux.sdram", ram_size);
+    memory_region_add_subregion(address_space_mem, ram_base, phys_ram);
 
     memory_region_init_rom_device(phys_flash, &pflash_cfi01_ops_be,
                                   NULL, "lm32_uclinux.flash", flash_size);
-- 
1.7.5.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]