[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/24] an5206: convert to memory API
From: |
Avi Kivity |
Subject: |
[Qemu-devel] [PATCH 07/24] an5206: convert to memory API |
Date: |
Wed, 24 Aug 2011 13:11:06 +0300 |
Signed-off-by: Avi Kivity <address@hidden>
---
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 <glib.h>
+
#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
- [Qemu-devel] [PATCH 11/24] integratorcp: convert to memory API (RAM/flash only), (continued)
[Qemu-devel] [PATCH 07/24] an5206: convert to memory API,
Avi Kivity <=
[Qemu-devel] [PATCH 03/24] sysbus: add helpers to add and delete memory regions to the system bus, Avi Kivity, 2011/08/24
[Qemu-devel] [PATCH 13/24] cirrus: wrap memory update in a transaction, Avi Kivity, 2011/08/24
[Qemu-devel] [PATCH 12/24] leon3: convert to memory API, Avi Kivity, 2011/08/24
[Qemu-devel] [PATCH 24/24] milkymist: convert to memory API, Avi Kivity, 2011/08/24
[Qemu-devel] [PATCH 15/24] Makefile.hw: allow hw/ files to include glib headers, Avi Kivity, 2011/08/24
[Qemu-devel] [PATCH 04/24] pci_host: convert conf index and data ports to memory API, Avi Kivity, 2011/08/24
[Qemu-devel] [PATCH 06/24] QEMUMachine: pass address space to machine init function, Avi Kivity, 2011/08/24