mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
libqos: allow qpci_iomap to return BAR mapping size
This patch allows qpci_iomap to return the size of the BAR mapping that it created, to allow driver applications (e.g, ahci-test) to make determinations about the suitability or the mapping size, or in the specific case of AHCI, how many ports are supported by the HBA. Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
7f2a5ae6c1
commit
6ce7100e7f
5 changed files with 10 additions and 7 deletions
|
@ -144,7 +144,7 @@ static void qpci_pc_config_writel(QPCIBus *bus, int devfn, uint8_t offset, uint3
|
|||
outl(0xcfc, value);
|
||||
}
|
||||
|
||||
static void *qpci_pc_iomap(QPCIBus *bus, QPCIDevice *dev, int barno)
|
||||
static void *qpci_pc_iomap(QPCIBus *bus, QPCIDevice *dev, int barno, uint64_t *sizeptr)
|
||||
{
|
||||
QPCIBusPC *s = container_of(bus, QPCIBusPC, bus);
|
||||
static const int bar_reg_map[] = {
|
||||
|
@ -173,6 +173,9 @@ static void *qpci_pc_iomap(QPCIBus *bus, QPCIDevice *dev, int barno)
|
|||
if (size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (sizeptr) {
|
||||
*sizeptr = size;
|
||||
}
|
||||
|
||||
if (io_type == PCI_BASE_ADDRESS_SPACE_IO) {
|
||||
uint16_t loc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue