Commit 7bf5be70f78b10cb9e679217db1c770e607bb2fb
1 parent
fb9f9444
pci memory mapping fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@844 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
5 additions
and
4 deletions
hw/pci.c
| @@ -214,7 +214,7 @@ void pci_default_write_config(PCIDevice *d, | @@ -214,7 +214,7 @@ void pci_default_write_config(PCIDevice *d, | ||
| 214 | uint32_t address, uint32_t val, int len) | 214 | uint32_t address, uint32_t val, int len) |
| 215 | { | 215 | { |
| 216 | int can_write, i; | 216 | int can_write, i; |
| 217 | - uint32_t end; | 217 | + uint32_t end, addr; |
| 218 | 218 | ||
| 219 | if (len == 4 && (address >= 0x10 && address < 0x10 + 4 * 6)) { | 219 | if (len == 4 && (address >= 0x10 && address < 0x10 + 4 * 6)) { |
| 220 | PCIIORegion *r; | 220 | PCIIORegion *r; |
| @@ -233,9 +233,10 @@ void pci_default_write_config(PCIDevice *d, | @@ -233,9 +233,10 @@ void pci_default_write_config(PCIDevice *d, | ||
| 233 | } | 233 | } |
| 234 | default_config: | 234 | default_config: |
| 235 | /* not efficient, but simple */ | 235 | /* not efficient, but simple */ |
| 236 | + addr = address; | ||
| 236 | for(i = 0; i < len; i++) { | 237 | for(i = 0; i < len; i++) { |
| 237 | /* default read/write accesses */ | 238 | /* default read/write accesses */ |
| 238 | - switch(address) { | 239 | + switch(addr) { |
| 239 | case 0x00: | 240 | case 0x00: |
| 240 | case 0x01: | 241 | case 0x01: |
| 241 | case 0x02: | 242 | case 0x02: |
| @@ -253,9 +254,9 @@ void pci_default_write_config(PCIDevice *d, | @@ -253,9 +254,9 @@ void pci_default_write_config(PCIDevice *d, | ||
| 253 | break; | 254 | break; |
| 254 | } | 255 | } |
| 255 | if (can_write) { | 256 | if (can_write) { |
| 256 | - d->config[address] = val; | 257 | + d->config[addr] = val; |
| 257 | } | 258 | } |
| 258 | - address++; | 259 | + addr++; |
| 259 | val >>= 8; | 260 | val >>= 8; |
| 260 | } | 261 | } |
| 261 | 262 |