From 16a96f288adccdd84c17c7d1696042a2a2009bfc Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 8 Aug 2011 16:08:55 +0300 Subject: 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 Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori --- hw/pci.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/pci.c') diff --git a/hw/pci.c b/hw/pci.c index 8621d3d2b1..c2c2699364 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) { -- cgit v1.2.3