[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 01/18] hw/sysbus: Add sysbus_mmio_get_region()
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH v2 01/18] hw/sysbus: Add sysbus_mmio_get_region() |
Date: |
Sun, 28 Aug 2011 17:56:51 +0100 |
Add a sysbus_mmio_get_region() which allows users of sysbus
devices to turn a (SysBusDevice*, mmioidx) tuple into a
MemoryRegion*. This enables some useful simplifications of
devices which pass through another device's mmio region
(either directly or by implementing some kind of memory
controller device).
Signed-off-by: Peter Maydell <address@hidden>
---
hw/sysbus.c | 5 +++++
hw/sysbus.h | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/hw/sysbus.c b/hw/sysbus.c
index f39768b..c365d39 100644
--- a/hw/sysbus.c
+++ b/hw/sysbus.c
@@ -131,6 +131,11 @@ void sysbus_init_mmio_region(SysBusDevice *dev,
MemoryRegion *memory)
dev->mmio[n].memory = memory;
}
+MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n)
+{
+ return dev->mmio[n].memory;
+}
+
void sysbus_init_ioports(SysBusDevice *dev, pio_addr_t ioport, pio_addr_t size)
{
pio_addr_t i;
diff --git a/hw/sysbus.h b/hw/sysbus.h
index b87c6c5..aa3d383 100644
--- a/hw/sysbus.h
+++ b/hw/sysbus.h
@@ -50,6 +50,7 @@ void sysbus_init_mmio(SysBusDevice *dev, target_phys_addr_t
size,
void sysbus_init_mmio_cb2(SysBusDevice *dev,
mmio_mapfunc cb, mmio_mapfunc unmap);
void sysbus_init_mmio_region(SysBusDevice *dev, MemoryRegion *memory);
+MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n);
void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p);
void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target);
void sysbus_init_ioports(SysBusDevice *dev, pio_addr_t ioport, pio_addr_t
size);
--
1.7.1
- [Qemu-devel] [PATCH v2 00/18] onenand, omap_gpmc fixes, features, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 01/18] hw/sysbus: Add sysbus_mmio_get_region(),
Peter Maydell <=
- [Qemu-devel] [PATCH v2 15/18] omap_gpmc: Accept a zero mask field on omap3630, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 06/18] omap_gpmc: Refactor omap_gpmc_cs_map and omap_gpmc_cs_unmap, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 05/18] omap_gpmc: Clean up omap_gpmc_attach MemoryRegion conversion, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 14/18] hw/omap.h: Add OMAP 3630 to omap_mpu_model enumeration, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 09/18] omap_gpmc: Fix handling of FIFOTHRESHOLDSTATUS bit, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 03/18] hw/onenand: Qdevify, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 13/18] omap_gpmc: Support NAND devices, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 04/18] hw/onenand: Minor spacing fixes, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 12/18] omap_gpmc: Reindent misindented switch statements, Peter Maydell, 2011/08/28
- [Qemu-devel] [PATCH v2 02/18] hw/onenand: Remove unnecessary argument from onenand_command(), Peter Maydell, 2011/08/28