qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: [Qemu-devel] [PATCH 13/25] sm501: Pass address_space_mem to sm501_init
Date: Sun,  2 Oct 2011 16:26:44 +0200	[thread overview]
Message-ID: <1317565616-12997-14-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1317565616-12997-1-git-send-email-avi@redhat.com>

From: Richard Henderson <rth@twiddle.net>

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/devices.h |    6 +++++-
 hw/r2d.c     |    5 ++++-
 hw/sm501.c   |    7 +++----
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/hw/devices.h b/hw/devices.h
index 07fda83..8ac384f 100644
--- a/hw/devices.h
+++ b/hw/devices.h
@@ -1,6 +1,9 @@
 #ifndef QEMU_DEVICES_H
 #define QEMU_DEVICES_H
 
+/* ??? Not all users of this file can include cpu-common.h.  */
+struct MemoryRegion;
+
 /* Devices that have nowhere better to go.  */
 
 /* smc91c111.c */
@@ -57,7 +60,8 @@ qemu_irq *tc6393xb_gpio_in_get(TC6393xbState *s);
 qemu_irq tc6393xb_l3v_get(TC6393xbState *s);
 
 /* sm501.c */
-void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
+void sm501_init(struct MemoryRegion *address_space_mem, uint32_t base,
+                uint32_t local_mem_bytes, qemu_irq irq,
                 CharDriverState *chr);
 
 #endif
diff --git a/hw/r2d.c b/hw/r2d.c
index b8b0df3..82377a0 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -37,6 +37,7 @@
 #include "usb.h"
 #include "flash.h"
 #include "blockdev.h"
+#include "exec-memory.h"
 
 #define FLASH_BASE 0x00000000
 #define FLASH_SIZE 0x02000000
@@ -235,6 +236,7 @@ static void r2d_init(ram_addr_t ram_size,
     qemu_irq *irq;
     DriveInfo *dinfo;
     int i;
+    MemoryRegion *address_space_mem = get_system_memory();
 
     if (!cpu_model)
         cpu_model = "SH7751R";
@@ -258,7 +260,8 @@ static void r2d_init(ram_addr_t ram_size,
     sysbus_create_varargs("sh_pci", 0x1e200000, irq[PCI_INTA], irq[PCI_INTB],
                           irq[PCI_INTC], irq[PCI_INTD], NULL);
 
-    sm501_init(0x10000000, SM501_VRAM_SIZE, irq[SM501], serial_hds[2]);
+    sm501_init(address_space_mem, 0x10000000, SM501_VRAM_SIZE,
+               irq[SM501], serial_hds[2]);
 
     /* onboard CF (True IDE mode, Master only). */
     dinfo = drive_get(IF_IDE, 0, 0);
diff --git a/hw/sm501.c b/hw/sm501.c
index 6b54717..a7ed6fa 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -30,7 +30,6 @@
 #include "sysbus.h"
 #include "qdev-addr.h"
 #include "range.h"
-#include "exec-memory.h"
 
 /*
  * Status: 2010/05/07
@@ -1386,8 +1385,8 @@ static void sm501_update_display(void *opaque)
 	sm501_draw_crt(s);
 }
 
-void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
-                CharDriverState *chr)
+void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
+                uint32_t local_mem_bytes, qemu_irq irq, CharDriverState *chr)
 {
     SM501State * s;
     DeviceState *dev;
@@ -1441,7 +1440,7 @@ void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
 
     /* bridge to serial emulation module */
     if (chr) {
-        serial_mm_init(get_system_memory(),
+        serial_mm_init(address_space_mem,
                        base + MMIO_BASE_OFFSET + SM501_UART0, 2,
                        NULL, /* TODO : chain irq to IRL */
                        115200, chr, DEVICE_NATIVE_ENDIAN);
-- 
1.7.6.3

  parent reply	other threads:[~2011-10-02 14:27 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-02 14:26 [Qemu-devel] [PULL 00/25] Memory API conversion, batch 10 Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 01/25] etrax-pic: Convert to MemoryRegion Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 02/25] etrax-ser: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 03/25] etrax-timer: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 04/25] etrax-dma: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 05/25] etrax-eth: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 06/25] serial: Convert serial_mm_init " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 07/25] serial: Use enum device_endian in serial_mm_init parameter Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 08/25] serial: Remove ioregister parameter from serial_mm_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 09/25] serial: Add MemoryRegion parameter to serial_mm_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 10/25] ppc405: Pass in address_space_mem to ppc405{cr, ep}_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 11/25] ppc440: Pass in address_space_mem to ppc440ep_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 12/25] pxa: Pass in address_space to pxa{255, 270}_init Avi Kivity
2011-10-02 14:26 ` Avi Kivity [this message]
2011-10-02 14:26 ` [Qemu-devel] [PATCH 14/25] sun4u: Pass address_space_mem to sun4uv_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 15/25] hw/smc91c111: Convert to MemoryRegion Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 16/25] openpic: Memory API conversion for mpic Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 17/25] milkymist-ac97: convert to memory API Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 18/25] milkymist-hpdmc: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 19/25] milkymist-memcard: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 20/25] milkymist-pfpu: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 21/25] milkymist-sysctl: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 22/25] milkymist-tmu2: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 23/25] milkymist-uart: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 24/25] milkymist-vgafb: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 25/25] milkymist-{minimac2, softusb}: rename memory names Avi Kivity
2011-10-09 10:33 ` [Qemu-devel] [PULL 00/25] Memory API conversion, batch 10 Avi Kivity
2011-10-09 11:01   ` Blue Swirl
2011-10-09 12:07     ` Avi Kivity
2011-10-09 12:50       ` Blue Swirl

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=1317565616-12997-14-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=anthony@codemonkey.ws \
    --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).