Files
xemu/tests/libqos
David Gibson a7b85b6062 libqos: Better handling of PCI legacy IO
The usual model for PCI IO with libqos is to use qpci_iomap() to map a
specific BAR for a PCI device, then perform IOs within that BAR using
qpci_io_{read,write}*().

However, certain devices also have legacy PCI IO.  In this case, instead of
(or as well as) being accessed via PCI BARs, the device can be accessed
via certain well-known, fixed addresses in PCI IO space.

Two existing tests use legacy PCI IO, and take different flawed approaches
to it:
    * tco-test manually constructs a tco_io_base value instead of calling
      qpci_iomap(), which assumes internal knowledge of the structure of
      the value it shouldn't have
    * ide-test uses direct in*() and out*() calls instead of using
      qpci_io_*() accessors, meaning it's not portable to non-x86 machine
      types.

This patch implements a new qpci_iomap_legacy() interface which gets a
handle in the same format as qpci_iomap() but refers to a region in
the legacy PIO space.  For a device which has the same registers
available both in a BAR and in legacy space (quite common), this
allows the same test code to test both options with just a different
iomap() at the beginning.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
2016-10-28 09:38:27 +11:00
..
2016-02-23 12:43:05 +00:00
2016-02-16 14:29:27 +00:00
2016-02-23 12:43:05 +00:00
2016-10-06 16:15:53 +11:00
2015-03-10 14:02:20 +01:00
2016-02-23 12:43:05 +00:00
2016-10-06 16:15:40 +11:00
2016-10-28 09:38:27 +11:00
2016-10-28 09:38:27 +11:00
2016-10-06 16:15:40 +11:00
2016-10-06 16:15:40 +11:00
2014-10-15 05:03:13 +02:00
2015-03-10 14:02:20 +01:00