aboutsummaryrefslogtreecommitdiffstats
path: root/hw/pci_host.c
AgeCommit message (Collapse)AuthorFilesLines
2010-03-07Update to a hopefully more future proof FSF addressBlue Swirl1-2/+1
See also 8167ee883931cb20c6264fc19d040ce2dc6ceaaa, 530e7615ce3c01882e582c84dc6304ab98a3d5c5 and fad6cb1a565bb73f83fc0e2654489457b489e436. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-02-14pci_host: rewrite using rwhandlerMichael S. Tsirkin1-102/+70
Save a ton of code by switching pcihost to use rwhandler. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-01-10PCI: Fix a typoBlue Swirl1-1/+1
Fixes build with PCI_DEBUG defined. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-01pci_host: remove unnecessary & 0xff.Isaku Yamahata1-2/+3
This patch removes unnecessary & 0xff in pci_dev_find_by_addr(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01pci: shorten pci_host_{conf, data}_register_xxx function a bit.Isaku Yamahata1-4/+4
pci_host_data_register_io_memory and its variants are too long a bit. So shorten them. Now they are pci_host_{conf, data}_register_{mmio, mmio_noswap, ioport}() Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01pci: rename (pci_/pcie_mmcfg_)addr_to_devIsaku Yamahata1-3/+3
This patch renames pci_addr_to_dev(), pcie_mmcfg_addr_to_dev() to pci_dev_find_by_addr(), pcie_dev_find_by_mmcfg_addr() as "Michael S. Tsirkin" <mst@redhat.com> suggested. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01pci: remove pci_addr_to_config() by open codeIsaku Yamahata1-7/+2
This patch removes pci_addr_to_config() and open code it as suggested by Michael S. Tsirkin <mst@redhat.com>. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01pci: simplify (pci_/pcie_mmcfg_)data_read()Michael S. Tsirkin1-16/+6
Remove switch on length: we don't care about high bits for value, so just return all ones if no device. And add one assert(). Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-11-09pci_host: change the signature of pci_data_{read, write}.Isaku Yamahata1-4/+2
change the first argument, void *opaque to PCIBus *s of the pci_data_{read, write}. They aren't used as direct callback so the argument type don't have to be void*. So change it to the right type. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09pci: move pci host stuff from pci.c to pci_host.cIsaku Yamahata1-0/+63
Move pci host stuff from pci.c to pci_host.c. And add some comments. Later pcie host bridge functions will be defined in pcie_host.c not to bloat pci.c. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09pci_host: consolidate pci config address access.Isaku Yamahata1-0/+108
consolidate pci_config address access into pci_host.c Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09pci_host.h: move functions in pci_host.h into .c file.Isaku Yamahata1-0/+75
split static functions in pci_host.h into pci_host.c and pci_host_template.h. Later a structures declared in pci_host.h, PCIHostState, will be used. However pci_host.h doesn't allow to include itself easily. This patches addresses it. pci_host.h includes functions which are instantiated in .c by including pci_host.h with typedefing pci_addr_t. pci_addr_t is per pci host bridge and is typedef'ed to uint32_t for ioio or target_phys_addr_t for mmio in .c file. That prevents from including pci_host.h to use PCIHostState because of requiring type, pci_addr_t. Its purpose to include is to instantiate io function for mmio or ioio depending on which pci host bridge requires ioio or mmio. To avoid including code, we always instantiate both version. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>