Revision a2d4e44b
b/hw/pci.c | ||
---|---|---|
242 | 242 |
uint32_t address, int len) |
243 | 243 |
{ |
244 | 244 |
uint32_t val; |
245 |
|
|
245 | 246 |
switch(len) { |
246 |
case 1: |
|
247 |
val = d->config[address]; |
|
248 |
break; |
|
249 |
case 2: |
|
250 |
val = le16_to_cpu(*(uint16_t *)(d->config + address)); |
|
251 |
break; |
|
252 | 247 |
default: |
253 | 248 |
case 4: |
254 |
val = le32_to_cpu(*(uint32_t *)(d->config + address)); |
|
249 |
if (address <= 0xfc) { |
|
250 |
val = le32_to_cpu(*(uint32_t *)(d->config + address)); |
|
251 |
break; |
|
252 |
} |
|
253 |
/* fall through */ |
|
254 |
case 2: |
|
255 |
if (address <= 0xfe) { |
|
256 |
val = le16_to_cpu(*(uint16_t *)(d->config + address)); |
|
257 |
break; |
|
258 |
} |
|
259 |
/* fall through */ |
|
260 |
case 1: |
|
261 |
val = d->config[address]; |
|
255 | 262 |
break; |
256 | 263 |
} |
257 | 264 |
return val; |
... | ... | |
341 | 348 |
if (can_write) { |
342 | 349 |
d->config[addr] = val; |
343 | 350 |
} |
344 |
addr++; |
|
351 |
if (++addr > 0xff) |
|
352 |
break; |
|
345 | 353 |
val >>= 8; |
346 | 354 |
} |
347 | 355 |
|
Also available in: Unified diff