aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-08-08 16:08:55 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-08 10:15:52 -0500
commit16a96f288adccdd84c17c7d1696042a2a2009bfc (patch)
treedae8e4ca7be3621970ae085a093cdfe0d0fd0fa6 /hw/pci.c
parent2dd3022826bb1ced27d12493a8f1f4b6d4bc71b7 (diff)
downloadqemu-16a96f288adccdd84c17c7d1696042a2a2009bfc.zip
qemu-16a96f288adccdd84c17c7d1696042a2a2009bfc.tar.gz
qemu-16a96f288adccdd84c17c7d1696042a2a2009bfc.tar.bz2
pci: add API to get a BAR's mapped address
Some (hacky) devices that have a back-channel to read this address back outside the normal configuration mechanisms, such as VMware svga. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 8621d3d..c2c2699 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -952,6 +952,11 @@ void pci_register_bar_region(PCIDevice *pci_dev, int region_num,
pci_dev->io_regions[region_num].memory = memory;
}
+pcibus_t pci_get_bar_addr(PCIDevice *pci_dev, int region_num)
+{
+ return pci_dev->io_regions[region_num].addr;
+}
+
static void pci_bridge_filter(PCIDevice *d, pcibus_t *addr, pcibus_t *size,
uint8_t type)
{