From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwAQw-0005UB-FD for qemu-devel@nongnu.org; Wed, 24 Aug 2011 06:11:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwAQk-0006Em-P2 for qemu-devel@nongnu.org; Wed, 24 Aug 2011 06:11:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwAQj-0006Df-SR 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 p7OABTEC023465 (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 p7OABScS022937 for ; Wed, 24 Aug 2011 06:11:28 -0400 From: Avi Kivity Date: Wed, 24 Aug 2011 13:11:06 +0300 Message-Id: <1314180683-8227-8-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 07/24] an5206: convert to memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Avi Kivity --- hw/an5206.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/an5206.c b/hw/an5206.c index e34de39..9a91984 100644 --- a/hw/an5206.c +++ b/hw/an5206.c @@ -6,6 +6,8 @@ * This code is licensed under the GPL */ +#include + #include "hw.h" #include "pc.h" #include "mcf.h" @@ -39,6 +41,8 @@ static void an5206_init(MemoryRegion *address_space_mem, int kernel_size; uint64_t elf_entry; target_phys_addr_t entry; + MemoryRegion *ram = g_new(MemoryRegion, 1); + MemoryRegion *sram = g_new(MemoryRegion, 1); if (!cpu_model) cpu_model = "m5206"; @@ -54,12 +58,12 @@ static void an5206_init(MemoryRegion *address_space_mem, env->rambar0 = AN5206_RAMBAR_ADDR | 1; /* DRAM at address zero */ - cpu_register_physical_memory(0, ram_size, - qemu_ram_alloc(NULL, "an5206.ram", ram_size) | IO_MEM_RAM); + memory_region_init_ram(ram, NULL, "an5206.ram", ram_size); + memory_region_add_subregion(address_space_mem, 0, ram); /* Internal SRAM. */ - cpu_register_physical_memory(AN5206_RAMBAR_ADDR, 512, - qemu_ram_alloc(NULL, "an5206.sram", 512) | IO_MEM_RAM); + memory_region_init_ram(sram, NULL, "an5206.sram", 512); + memory_region_add_subregion(address_space_mem, AN5206_RAMBAR_ADDR, sram); mcf5206_init(AN5206_MBAR_ADDR, env); -- 1.7.5.3