diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-04 17:15:22 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-04 17:15:22 -0500 |
commit | 81e34a2401f7ffd519bb7f093e833cb48734169f (patch) | |
tree | 146a7b6eebbee1367453fde501d4462ac6d9f8b4 /hw/pci.c | |
parent | e06516f565dca3636a4cbef770b191a5fcdf63ab (diff) | |
parent | cb4b4fde82b064472c13fb9d983ca36a70e560aa (diff) | |
download | qemu-81e34a2401f7ffd519bb7f093e833cb48734169f.zip |
Merge remote-tracking branch 'mst/for_anthony' into staging
Diffstat (limited to 'hw/pci.c')
-rw-r--r-- | hw/pci.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1145,8 +1145,7 @@ uint32_t pci_default_read_config(PCIDevice *d, uint32_t address, int len) { uint32_t val = 0; - assert(len == 1 || len == 2 || len == 4); - len = MIN(len, pci_config_size(d) - address); + memcpy(&val, d->config + address, len); return le32_to_cpu(val); } @@ -1154,9 +1153,8 @@ uint32_t pci_default_read_config(PCIDevice *d, void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int l) { int i, was_irq_disabled = pci_irq_disabled(d); - uint32_t config_size = pci_config_size(d); - for (i = 0; i < l && addr + i < config_size; val >>= 8, ++i) { + for (i = 0; i < l; val >>= 8, ++i) { uint8_t wmask = d->wmask[addr + i]; uint8_t w1cmask = d->w1cmask[addr + i]; assert(!(wmask & w1cmask)); |