qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 04/25] petalogix_ml605: convert to memory API
Date: Thu,  6 Oct 2011 12:23:14 +0200	[thread overview]
Message-ID: <1317896615-25202-5-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1317896615-25202-1-git-send-email-avi@redhat.com>

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/petalogix_ml605_mmu.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/hw/petalogix_ml605_mmu.c b/hw/petalogix_ml605_mmu.c
index 2a0f7fd..fb4ba29 100644
--- a/hw/petalogix_ml605_mmu.c
+++ b/hw/petalogix_ml605_mmu.c
@@ -149,8 +149,8 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr)
     DriveInfo *dinfo;
     int i;
     target_phys_addr_t ddr_base = MEMORY_BASEADDR;
-    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;
 
     /* init CPUs */
@@ -162,13 +162,12 @@ 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_ml605.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_ml605.lmb_bram",
+                           LMB_BRAM_SIZE);
+    memory_region_add_subregion(address_space_mem, 0x00000000, phys_lmb_bram);
 
-    phys_ram = qemu_ram_alloc(NULL, "petalogix_ml605.ram", ram_size);
-    cpu_register_physical_memory(ddr_base, ram_size, phys_ram | IO_MEM_RAM);
+    memory_region_init_ram(phys_ram, NULL, "petalogix_ml605.ram", ram_size);
+    memory_region_add_subregion(address_space_mem, ddr_base, phys_ram);
 
     dinfo = drive_get(IF_PFLASH, 0, 0);
     /* 5th parameter 2 means bank-width
-- 
1.7.6.3

  parent reply	other threads:[~2011-10-06 10:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-06 10:23 [Qemu-devel] [PATCH 00/25] Memory API converions, batch 11 Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 01/25] hw/lan9118.c: Convert to MemoryRegion Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 02/25] PPC: Fix via-cuda memory registration Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 03/25] palm: convert to memory API Avi Kivity
2011-10-06 10:23 ` Avi Kivity [this message]
2011-10-06 10:23 ` [Qemu-devel] [PATCH 05/25] petalogix_s2adsp1800: " Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 06/25] ppc405_boards: " Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 07/25] hw/arm11mpcore: Clean up to avoid using sysbus_mmio_init_cb2 Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 08/25] hw/versatile_pci: Expose multiple sysbus mmio regions Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 09/25] ppc_newworld: convert to memory API Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 10/25] isa: Tidy support code for isabus_get_fw_dev_path Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 11/25] Introduce PortioList Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 12/25] memory: Fix old portio word accesses Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 13/25] isa: Add isa_register_portio_list() Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 14/25] fdc: Convert to isa_register_portio_list Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 15/25] gus: " Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 16/25] m48t59: Convert to isa_register_ioport Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 17/25] rtc: " Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 18/25] ne2000: " Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 19/25] parallel: Convert to isa_register_portio_list Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 20/25] sb16: " Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 21/25] vga: " Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 22/25] pc: Convert port92 to isa_register_ioport Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 23/25] vmport: Convert " Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 24/25] ide: Convert to isa_register_portio_list Avi Kivity
2011-10-06 10:23 ` [Qemu-devel] [PATCH 25/25] isa: Remove isa_init_ioport_range and isa_init_ioport Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317896615-25202-5-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).