[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/24] axis_dev88: convert to memory API (RAM only)
From: |
Avi Kivity |
Subject: |
[Qemu-devel] [PATCH 09/24] axis_dev88: convert to memory API (RAM only) |
Date: |
Wed, 24 Aug 2011 13:11:08 +0300 |
Signed-off-by: Avi Kivity <address@hidden>
---
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 <glib.h>
+
#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
- [Qemu-devel] [PATCH 00/24] Memory API conversions, batch 5, Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 01/24] arm_sysctl: convert to memory API, Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 05/24] ReadWriteHandler: remove, Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 14/24] piix_pci: wrap memory update in a transaction, Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 09/24] axis_dev88: convert to memory API (RAM only),
Avi Kivity <=
- [Qemu-devel] [PATCH 23/24] milkymist-softusb: convert to memory API, Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 02/24] stellaris_enet: convert to memory API, Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 19/24] lm32_boards: convert to memory API, Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 08/24] armv7m: convert to memory API, Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 17/24] dummy_m68k: convert to memory API, Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 10/24] sysbus: add sysbus_add_memory_overlap(), Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 11/24] integratorcp: convert to memory API (RAM/flash only), Avi Kivity, 2011/08/24
- [Qemu-devel] [PATCH 20/24] mainstone: convert to memory API, Avi Kivity, 2011/08/24