qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 02/39] pci: add API to get a BAR's mapped add


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH v3 02/39] pci: add API to get a BAR's mapped address
Date: Fri, 05 Aug 2011 08:53:45 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 08/04/2011 08:05 AM, Avi Kivity wrote:
This is a hack, for devices that have a back-channel to read this
address back outside the normal configuration mechanisms, such
as VMware svga.

Reviewed-by: Richard Henderson<address@hidden>
Signed-off-by: Avi Kivity<address@hidden>

Can we add a comment to the header file to this effect?

Michael, if you ever have some free time and are feeling generous, adding docs to the pci functions would be quite helpful.

Regards,

Anthony Liguori

---
  hw/pci.c |    5 +++++
  hw/pci.h |    1 +
  2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index 36db58b..912f849 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)
  {
diff --git a/hw/pci.h b/hw/pci.h
index c51156d..64282ad 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -207,6 +207,7 @@ void pci_register_bar_simple(PCIDevice *pci_dev, int 
region_num,
                               pcibus_t size, uint8_t attr, ram_addr_t 
ram_addr);
  void pci_register_bar_region(PCIDevice *pci_dev, int region_num,
                               uint8_t attr, MemoryRegion *memory);
+pcibus_t pci_get_bar_addr(PCIDevice *pci_dev, int region_num);

  int pci_add_capability(PCIDevice *pdev, uint8_t cap_id,
                         uint8_t offset, uint8_t size);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]