diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-03-16 10:20:34 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-05-19 16:42:30 +0200 |
commit | 89a80e7400f7225d9401b35ef32454b4ab29dc67 (patch) | |
tree | 1ab07269c819c8eb7d128ec27bbbf9d5e61825d7 /include | |
parent | 63c915526d6a54a95919ebece83fa9ca631b2508 (diff) |
hw: remove pio_addr_t
pio_addr_t is almost unused, because these days I/O ports are simply
accessed through the address space. cpu_{in,out}[bwl] themselves are
almost unused; monitor.c and xen-hvm.c could use address_space_read/write
directly, since they have an integer size at hand. This leaves qtest as
the only user of those functions.
On the other hand even portio_* functions use this type; the only
interesting use of pio_addr_t thus is include/hw/sysbus.h. I guess I
could move it there, but I don't see much benefit in that either. Using
uint32_t is enough and avoids the need to include ioport.h everywhere.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/exec/ioport.h | 15 | ||||
-rw-r--r-- | include/hw/sysbus.h | 4 |
2 files changed, 8 insertions, 11 deletions
diff --git a/include/exec/ioport.h b/include/exec/ioport.h index 3bd6722627..6a9639cc4d 100644 --- a/include/exec/ioport.h +++ b/include/exec/ioport.h @@ -28,9 +28,6 @@ #include "qom/object.h" #include "exec/memory.h" -typedef uint32_t pio_addr_t; -#define FMT_pioaddr PRIx32 - #define MAX_IOPORTS (64 * 1024) #define IOPORTS_MASK (MAX_IOPORTS - 1) @@ -49,12 +46,12 @@ typedef struct MemoryRegionPortio { extern const MemoryRegionOps unassigned_io_ops; #endif -void cpu_outb(pio_addr_t addr, uint8_t val); -void cpu_outw(pio_addr_t addr, uint16_t val); -void cpu_outl(pio_addr_t addr, uint32_t val); -uint8_t cpu_inb(pio_addr_t addr); -uint16_t cpu_inw(pio_addr_t addr); -uint32_t cpu_inl(pio_addr_t addr); +void cpu_outb(uint32_t addr, uint8_t val); +void cpu_outw(uint32_t addr, uint16_t val); +void cpu_outl(uint32_t addr, uint32_t val); +uint8_t cpu_inb(uint32_t addr); +uint16_t cpu_inw(uint32_t addr); +uint32_t cpu_inl(uint32_t addr); typedef struct PortioList { const struct MemoryRegionPortio *ports; diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index cc1dba49bf..a4959378d4 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -72,7 +72,7 @@ struct SysBusDevice { MemoryRegion *memory; } mmio[QDEV_MAX_MMIO]; int num_pio; - pio_addr_t pio[QDEV_MAX_PIO]; + uint32_t pio[QDEV_MAX_PIO]; }; typedef int FindSysbusDeviceFunc(SysBusDevice *sbdev, void *opaque); @@ -81,7 +81,7 @@ void sysbus_init_mmio(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); +void sysbus_init_ioports(SysBusDevice *dev, uint32_t ioport, uint32_t size); bool sysbus_has_irq(SysBusDevice *dev, int n); |