diff options
author | Avi Kivity <avi@redhat.com> | 2011-08-08 21:05:07 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-09-04 17:46:51 +0300 |
commit | 88fa8031bde51ad6b4bf5578dd7c19c484921ebe (patch) | |
tree | df11b4c05f54bac8bf786380ab37d3f264a2cbc3 /hw/lm32_boards.c | |
parent | cbdea0ca89d1b61f11f2fa4f044054bde55bbc3b (diff) | |
download | hqemu-88fa8031bde51ad6b4bf5578dd7c19c484921ebe.zip hqemu-88fa8031bde51ad6b4bf5578dd7c19c484921ebe.tar.gz |
lm32_boards: convert to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/lm32_boards.c')
-rw-r--r-- | hw/lm32_boards.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/hw/lm32_boards.c b/hw/lm32_boards.c index e4acac1..97e1c00 100644 --- a/hw/lm32_boards.c +++ b/hw/lm32_boards.c @@ -28,6 +28,7 @@ #include "elf.h" #include "lm32_hwsetup.h" #include "lm32.h" +#include "exec-memory.h" typedef struct { CPUState *env; @@ -76,7 +77,8 @@ static void lm32_evr_init(ram_addr_t ram_size_not_used, { CPUState *env; DriveInfo *dinfo; - ram_addr_t phys_ram; + MemoryRegion *address_space_mem = get_system_memory(); + MemoryRegion *phys_ram = g_new(MemoryRegion, 1); qemu_irq *cpu_irq, irq[32]; ResetInfo *reset_info; int i; @@ -104,8 +106,8 @@ static void lm32_evr_init(ram_addr_t ram_size_not_used, 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); dinfo = drive_get(IF_PFLASH, 0, 0); /* Spansion S29NS128P */ @@ -162,7 +164,8 @@ static void lm32_uclinux_init(ram_addr_t ram_size_not_used, { CPUState *env; DriveInfo *dinfo; - ram_addr_t phys_ram; + MemoryRegion *address_space_mem = get_system_memory(); + MemoryRegion *phys_ram = g_new(MemoryRegion, 1); qemu_irq *cpu_irq, irq[32]; HWSetup *hw; ResetInfo *reset_info; @@ -197,8 +200,8 @@ static void lm32_uclinux_init(ram_addr_t ram_size_not_used, 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); dinfo = drive_get(IF_PFLASH, 0, 0); /* Spansion S29NS128P */ |