qemu/tests/libqos
David Gibson b8cc4d0231 libqos: Move BAR assignment to common code
The PCI backends in libqos each supply an iomap() and iounmap() function
which is used to set up a specified PCI BAR.  But PCI BAR allocation takes
place entirely within PCI space, so doesn't really need per-backend
versions.  For example, Linux includes generic BAR allocation code used on
platforms where that isn't done by firmware.

This patch merges the BAR allocation from the two existing backends into a
single simplified copy.  The back ends just need to set up some parameters
describing the window of PCI IO and PCI memory addresses which are
available for allocation.  Like both the existing versions the new one uses
a simple bump allocator.

Note that (again like the existing versions) this doesn't really handle
64-bit memory BARs properly.  It is actually used for such a BAR by the
ivshmem test, and apparently the 32-bit MMIO BAR logic is close enough to
work, as long as the BAR isn't too big.  Fixing that to properly handle
64-bit BAR allocation is a problem for another time.

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
..
ahci.c libqos: add PCI management in qtest_vboot()/qtest_shutdown() 2016-10-06 16:15:53 +11:00
ahci.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
fw_cfg.c tests: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
fw_cfg.h all: Clean up includes 2016-02-23 12:43:05 +00:00
i2c-imx.c tests: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
i2c-omap.c tests: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
i2c.c tests: Clean up includes 2016-02-16 14:29:27 +00:00
i2c.h all: Clean up includes 2016-02-23 12:43:05 +00:00
libqos-pc.c libqos: use generic qtest_shutdown() 2016-10-06 16:15:53 +11:00
libqos-pc.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
libqos-spapr.c libqos: use generic qtest_shutdown() 2016-10-06 16:15:53 +11:00
libqos-spapr.h libqos: define SPAPR libqos functions 2016-09-23 10:29:40 +10:00
libqos.c tests: don't check if qtest_spapr_boot() returns NULL 2016-10-28 09:36:58 +11:00
libqos.h libqos: use generic qtest_shutdown() 2016-10-06 16:15:53 +11:00
malloc-generic.c tests: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
malloc-generic.h libqos: Add malloc generic 2015-03-10 14:02:20 +01:00
malloc-pc.c tests: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
malloc-pc.h libqos: Convert malloc-pc allocator to a generic allocator 2015-01-13 11:47:57 +00:00
malloc-spapr.c libqos: define SPAPR libqos functions 2016-09-23 10:29:40 +10:00
malloc-spapr.h libqos: define SPAPR libqos functions 2016-09-23 10:29:40 +10:00
malloc.c tests: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
malloc.h all: Clean up includes 2016-02-23 12:43:05 +00:00
pci-pc.c libqos: Move BAR assignment to common code 2016-10-28 09:38:27 +11:00
pci-pc.h libqos: add PCI management in qtest_vboot()/qtest_shutdown() 2016-10-06 16:15:53 +11:00
pci-spapr.c libqos: Move BAR assignment to common code 2016-10-28 09:38:27 +11:00
pci-spapr.h libqos: add PPC64 PCI support 2016-10-06 16:15:40 +11:00
pci.c libqos: Move BAR assignment to common code 2016-10-28 09:38:27 +11:00
pci.h libqos: Move BAR assignment to common code 2016-10-28 09:38:27 +11:00
rtas.c libqos: add PPC64 PCI support 2016-10-06 16:15:40 +11:00
rtas.h libqos: add PPC64 PCI support 2016-10-06 16:15:40 +11:00
usb.c tests: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
usb.h tests: usb: Generic usb device hotplug 2014-10-15 05:03:13 +02:00
virtio-mmio.c libqos: Give qvirtio_config_read*() consistent semantics 2016-10-28 09:38:27 +11:00
virtio-mmio.h libqos: Add virtio MMIO support 2015-03-10 14:02:20 +01:00
virtio-pci.c libqos: Give qvirtio_config_read*() consistent semantics 2016-10-28 09:38:27 +11:00
virtio-pci.h libqos: drop duplicated virtio_pci.h definitions 2016-06-20 11:44:12 +01:00
virtio.c tests: move QVirtioBus pointer into QVirtioDevice 2016-10-28 09:36:58 +11:00
virtio.h tests: rename target_big_endian() as qvirtio_is_big_endian() 2016-10-28 09:36:58 +11:00