summaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-22 16:28:18 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-22 16:28:18 +0000
commit7bf5be70f78b10cb9e679217db1c770e607bb2fb (patch)
treecf5181b137351a5d5dd39576480fbefa207c3d6b /hw/pci.c
parentfb9f9444588d2f7f1af9692499b3953432151e64 (diff)
pci memory mapping fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@844 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/pci.c b/hw/pci.c
index ff5a44efba..2d8fcbcc5b 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -214,7 +214,7 @@ void pci_default_write_config(PCIDevice *d,
uint32_t address, uint32_t val, int len)
{
int can_write, i;
- uint32_t end;
+ uint32_t end, addr;
if (len == 4 && (address >= 0x10 && address < 0x10 + 4 * 6)) {
PCIIORegion *r;
@@ -233,9 +233,10 @@ void pci_default_write_config(PCIDevice *d,
}
default_config:
/* not efficient, but simple */
+ addr = address;
for(i = 0; i < len; i++) {
/* default read/write accesses */
- switch(address) {
+ switch(addr) {
case 0x00:
case 0x01:
case 0x02:
@@ -253,9 +254,9 @@ void pci_default_write_config(PCIDevice *d,
break;
}
if (can_write) {
- d->config[address] = val;
+ d->config[addr] = val;
}
- address++;
+ addr++;
val >>= 8;
}