aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-12-27 20:52:36 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-12-27 20:52:36 +0000
commitcf616802171905a9b6d087a69caa3b978b9cd741 (patch)
tree75a483097b653da87a2bd90cab2853597e6f5579 /hw/pci.c
parent6bb4ca57a15ab9458ce8821572def6758131d8b9 (diff)
PCI: Fix bus address conversion
Pass physical addresses to map functions instead of PCI bus addresses. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 9722fce53d..081438338d 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -949,7 +949,12 @@ static void pci_update_mappings(PCIDevice *d)
* Teach them such cases, such that filtered_size < size and
* addr & (size - 1) != 0.
*/
- r->map_func(d, i, r->addr, r->filtered_size, r->type);
+ if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
+ r->map_func(d, i, r->addr, r->filtered_size, r->type);
+ } else {
+ r->map_func(d, i, pci_to_cpu_addr(d->bus, r->addr),
+ r->filtered_size, r->type);
+ }
}
}
}