diff mbox

[V4,1/8] isa: add isa_address_space_io

Message ID f2b097df83192ce247762a9d80f396cadaa8663d.1334230338.git.julien.grall@citrix.com
State New
Headers show

Commit Message

Julien Grall April 12, 2012, 11:45 a.m. UTC
This function permits to retrieve ISA IO address space.
It will be usefull when we need to pass IO address space as argument.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
---
 hw/isa-bus.c |    5 +++++
 hw/isa.h     |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

Comments

Anthony Liguori April 23, 2012, 6:31 p.m. UTC | #1
On 04/12/2012 06:45 AM, Julien Grall wrote:
> This function permits to retrieve ISA IO address space.
> It will be usefull when we need to pass IO address space as argument.
>
> Signed-off-by: Julien Grall<julien.grall@citrix.com>
> ---
>   hw/isa-bus.c |    5 +++++
>   hw/isa.h     |    1 +
>   2 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/hw/isa-bus.c b/hw/isa-bus.c
> index 5a43f03..043e1f7 100644
> --- a/hw/isa-bus.c
> +++ b/hw/isa-bus.c
> @@ -235,4 +235,9 @@ MemoryRegion *isa_address_space(ISADevice *dev)
>       return get_system_memory();
>   }
>
> +MemoryRegion *isa_address_space_io(ISADevice *dev)
> +{
> +    return get_system_io();
> +}
> +

You should return ISA_BUS(DEVICE(dev)->parent_bus)->address_space_io.

Regards,

Anthony Liguori

>   type_init(isabus_register_types)
> diff --git a/hw/isa.h b/hw/isa.h
> index 40373fb..a9bf65a 100644
> --- a/hw/isa.h
> +++ b/hw/isa.h
> @@ -42,6 +42,7 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
>   qemu_irq isa_get_irq(ISADevice *dev, int isairq);
>   void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
>   MemoryRegion *isa_address_space(ISADevice *dev);
> +MemoryRegion *isa_address_space_io(ISADevice *dev);
>   ISADevice *isa_create(ISABus *bus, const char *name);
>   ISADevice *isa_try_create(ISABus *bus, const char *name);
>   ISADevice *isa_create_simple(ISABus *bus, const char *name);
diff mbox

Patch

diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 5a43f03..043e1f7 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -235,4 +235,9 @@  MemoryRegion *isa_address_space(ISADevice *dev)
     return get_system_memory();
 }
 
+MemoryRegion *isa_address_space_io(ISADevice *dev)
+{
+    return get_system_io();
+}
+
 type_init(isabus_register_types)
diff --git a/hw/isa.h b/hw/isa.h
index 40373fb..a9bf65a 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -42,6 +42,7 @@  void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
 qemu_irq isa_get_irq(ISADevice *dev, int isairq);
 void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
 MemoryRegion *isa_address_space(ISADevice *dev);
+MemoryRegion *isa_address_space_io(ISADevice *dev);
 ISADevice *isa_create(ISABus *bus, const char *name);
 ISADevice *isa_try_create(ISABus *bus, const char *name);
 ISADevice *isa_create_simple(ISABus *bus, const char *name);