sm501: Pass address_space_mem to sm501_init

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Richard Henderson 2011-08-11 16:07:20 -07:00 committed by Avi Kivity
parent a6dc4c2d95
commit 27a9d2eacb
3 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,9 @@
#ifndef QEMU_DEVICES_H #ifndef QEMU_DEVICES_H
#define 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. */ /* Devices that have nowhere better to go. */
/* smc91c111.c */ /* smc91c111.c */
@ -57,7 +60,8 @@ qemu_irq *tc6393xb_gpio_in_get(TC6393xbState *s);
qemu_irq tc6393xb_l3v_get(TC6393xbState *s); qemu_irq tc6393xb_l3v_get(TC6393xbState *s);
/* sm501.c */ /* 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); CharDriverState *chr);
#endif #endif

View File

@ -37,6 +37,7 @@
#include "usb.h" #include "usb.h"
#include "flash.h" #include "flash.h"
#include "blockdev.h" #include "blockdev.h"
#include "exec-memory.h"
#define FLASH_BASE 0x00000000 #define FLASH_BASE 0x00000000
#define FLASH_SIZE 0x02000000 #define FLASH_SIZE 0x02000000
@ -235,6 +236,7 @@ static void r2d_init(ram_addr_t ram_size,
qemu_irq *irq; qemu_irq *irq;
DriveInfo *dinfo; DriveInfo *dinfo;
int i; int i;
MemoryRegion *address_space_mem = get_system_memory();
if (!cpu_model) if (!cpu_model)
cpu_model = "SH7751R"; 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], sysbus_create_varargs("sh_pci", 0x1e200000, irq[PCI_INTA], irq[PCI_INTB],
irq[PCI_INTC], irq[PCI_INTD], NULL); 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). */ /* onboard CF (True IDE mode, Master only). */
dinfo = drive_get(IF_IDE, 0, 0); dinfo = drive_get(IF_IDE, 0, 0);

View File

@ -30,7 +30,6 @@
#include "sysbus.h" #include "sysbus.h"
#include "qdev-addr.h" #include "qdev-addr.h"
#include "range.h" #include "range.h"
#include "exec-memory.h"
/* /*
* Status: 2010/05/07 * Status: 2010/05/07
@ -1386,8 +1385,8 @@ static void sm501_update_display(void *opaque)
sm501_draw_crt(s); sm501_draw_crt(s);
} }
void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq, void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
CharDriverState *chr) uint32_t local_mem_bytes, qemu_irq irq, CharDriverState *chr)
{ {
SM501State * s; SM501State * s;
DeviceState *dev; 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 */ /* bridge to serial emulation module */
if (chr) { if (chr) {
serial_mm_init(get_system_memory(), serial_mm_init(address_space_mem,
base + MMIO_BASE_OFFSET + SM501_UART0, 2, base + MMIO_BASE_OFFSET + SM501_UART0, 2,
NULL, /* TODO : chain irq to IRL */ NULL, /* TODO : chain irq to IRL */
115200, chr, DEVICE_NATIVE_ENDIAN); 115200, chr, DEVICE_NATIVE_ENDIAN);