From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwAQr-0005H8-5x for qemu-devel@nongnu.org; Wed, 24 Aug 2011 06:11:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwAQk-0006Ez-SE for qemu-devel@nongnu.org; Wed, 24 Aug 2011 06:11:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwAQj-0006De-Sp for qemu-devel@nongnu.org; Wed, 24 Aug 2011 06:11:30 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7OABTx3017388 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 24 Aug 2011 06:11:29 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7OABSmO022939 for ; Wed, 24 Aug 2011 06:11:28 -0400 From: Avi Kivity Date: Wed, 24 Aug 2011 13:11:08 +0300 Message-Id: <1314180683-8227-10-git-send-email-avi@redhat.com> In-Reply-To: <1314180683-8227-1-git-send-email-avi@redhat.com> References: <1314180683-8227-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 09/24] axis_dev88: convert to memory API (RAM only) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Avi Kivity --- hw/axis_dev88.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c index cfc89c2..04a3d5b 100644 --- a/hw/axis_dev88.c +++ b/hw/axis_dev88.c @@ -22,6 +22,8 @@ * THE SOFTWARE. */ +#include + #include "sysbus.h" #include "net.h" #include "flash.h" @@ -261,8 +263,8 @@ void axisdev88_init (MemoryRegion *address_space_mem, int i; int nand_regs; int gpio_regs; - ram_addr_t phys_ram; - ram_addr_t phys_intmem; + MemoryRegion *phys_ram = g_new(MemoryRegion, 1); + MemoryRegion *phys_intmem = g_new(MemoryRegion, 1); /* init CPUs */ if (cpu_model == NULL) { @@ -271,15 +273,13 @@ void axisdev88_init (MemoryRegion *address_space_mem, env = cpu_init(cpu_model); /* allocate RAM */ - phys_ram = qemu_ram_alloc(NULL, "axisdev88.ram", ram_size); - cpu_register_physical_memory(0x40000000, ram_size, phys_ram | IO_MEM_RAM); + memory_region_init_ram(phys_ram, NULL, "axisdev88.ram", ram_size); + memory_region_add_subregion(address_space_mem, 0x40000000, phys_ram); /* The ETRAX-FS has 128Kb on chip ram, the docs refer to it as the internal memory. */ - phys_intmem = qemu_ram_alloc(NULL, "axisdev88.chipram", INTMEM_SIZE); - cpu_register_physical_memory(0x38000000, INTMEM_SIZE, - phys_intmem | IO_MEM_RAM); - + memory_region_init_ram(phys_intmem, NULL, "axisdev88.chipram", INTMEM_SIZE); + memory_region_add_subregion(address_space_mem, 0x38000000, phys_intmem); /* Attach a NAND flash to CS1. */ nand = drive_get(IF_MTD, 0, 0); -- 1.7.5.3