Commit 7bf5be70f78b10cb9e679217db1c770e607bb2fb

Authored by bellard
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 214 uint32_t address, uint32_t val, int len)
215 215 {
216 216 int can_write, i;
217   - uint32_t end;
  217 + uint32_t end, addr;
218 218  
219 219 if (len == 4 && (address >= 0x10 && address < 0x10 + 4 * 6)) {
220 220 PCIIORegion *r;
... ... @@ -233,9 +233,10 @@ void pci_default_write_config(PCIDevice *d,
233 233 }
234 234 default_config:
235 235 /* not efficient, but simple */
  236 + addr = address;
236 237 for(i = 0; i < len; i++) {
237 238 /* default read/write accesses */
238   - switch(address) {
  239 + switch(addr) {
239 240 case 0x00:
240 241 case 0x01:
241 242 case 0x02:
... ... @@ -253,9 +254,9 @@ void pci_default_write_config(PCIDevice *d,
253 254 break;
254 255 }
255 256 if (can_write) {
256   - d->config[address] = val;
  257 + d->config[addr] = val;
257 258 }
258   - address++;
  259 + addr++;
259 260 val >>= 8;
260 261 }
261 262  
... ...