From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDHL5-0005Yq-VG for qemu-devel@nongnu.org; Mon, 10 Oct 2011 11:00:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDHL1-00027F-Bs for qemu-devel@nongnu.org; Mon, 10 Oct 2011 11:00:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDHL1-00026D-1v for qemu-devel@nongnu.org; Mon, 10 Oct 2011 11:00:19 -0400 From: Avi Kivity Date: Mon, 10 Oct 2011 16:59:33 +0200 Message-Id: <1318258793-10576-5-git-send-email-avi@redhat.com> In-Reply-To: <1318258793-10576-1-git-send-email-avi@redhat.com> References: <1318258793-10576-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 04/24] petalogix_s2adsp1800: convert to memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org Signed-off-by: Avi Kivity --- hw/petalogix_s3adsp1800_mmu.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c index 66fb96d..17da2fd 100644 --- a/hw/petalogix_s3adsp1800_mmu.c +++ b/hw/petalogix_s3adsp1800_mmu.c @@ -35,6 +35,7 @@ #include "loader.h" #include "elf.h" #include "blockdev.h" +#include "exec-memory.h" #include "microblaze_pic_cpu.h" @@ -125,9 +126,10 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr) DriveInfo *dinfo; int i; target_phys_addr_t ddr_base = 0x90000000; - ram_addr_t phys_lmb_bram; - ram_addr_t phys_ram; + MemoryRegion *phys_lmb_bram = g_new(MemoryRegion, 1); + MemoryRegion *phys_ram = g_new(MemoryRegion, 1); qemu_irq irq[32], *cpu_irq; + MemoryRegion *sysmem = get_system_memory(); /* init CPUs */ if (cpu_model == NULL) { @@ -139,13 +141,13 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr) qemu_register_reset(main_cpu_reset, env); /* Attach emulated BRAM through the LMB. */ - phys_lmb_bram = qemu_ram_alloc(NULL, "petalogix_s3adsp1800.lmb_bram", - LMB_BRAM_SIZE); - cpu_register_physical_memory(0x00000000, LMB_BRAM_SIZE, - phys_lmb_bram | IO_MEM_RAM); + memory_region_init_ram(phys_lmb_bram, NULL, + "petalogix_s3adsp1800.lmb_bram", LMB_BRAM_SIZE); + memory_region_add_subregion(sysmem, 0x00000000, phys_lmb_bram); - phys_ram = qemu_ram_alloc(NULL, "petalogix_s3adsp1800.ram", ram_size); - cpu_register_physical_memory(ddr_base, ram_size, phys_ram | IO_MEM_RAM); + memory_region_init_ram(phys_ram, NULL, "petalogix_s3adsp1800.ram", + ram_size); + memory_region_add_subregion(sysmem, ddr_base, phys_ram); dinfo = drive_get(IF_PFLASH, 0, 0); pflash_cfi01_register(0xa0000000, -- 1.7.6.3