diff options
author | Igor V. Kovalenko <igor.v.kovalenko@gmail.com> | 2010-04-23 01:54:50 +0400 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-05-01 19:44:54 +0000 |
commit | 50a480946b980c2000fc3b13bda174d57b45fbdd (patch) | |
tree | b6bf812a505d553bd8eea9a5df521b9763f330b8 | |
parent | 70ae65f5d91462e1905a53236179fde21cda3a2f (diff) | |
download | qemu-50a480946b980c2000fc3b13bda174d57b45fbdd.tar.gz qemu-50a480946b980c2000fc3b13bda174d57b45fbdd.tar.bz2 qemu-50a480946b980c2000fc3b13bda174d57b45fbdd.zip |
cmd646: fix abort due to changed opaque pointer for ioport read
We cannot install different opaque pointer for read and write
of the same i/o address.
- handle zero address in bmdma_writeb_common and install
the same opaque pointer for both read and write access.
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r-- | hw/ide/cmd646.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index c6ed0b707a..cdcc9bf1aa 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -123,6 +123,9 @@ static void bmdma_writeb_common(PCIIDEState *pci_dev, BMDMAState *bm, printf("bmdma: writeb 0x%02x : 0x%02x\n", addr, val); #endif switch(addr & 3) { + case 0: + bmdma_cmd_writeb(bm, addr, val); + break; case 1: pci_dev->dev.config[MRDMODE] = (pci_dev->dev.config[MRDMODE] & ~0x30) | (val & 0x30); @@ -168,13 +171,11 @@ static void bmdma_map(PCIDevice *pci_dev, int region_num, bm->bus = d->bus+i; qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm); - register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm); - if (i == 0) { - register_ioport_write(addr + 1, 3, 1, bmdma_writeb_0, d); + register_ioport_write(addr, 4, 1, bmdma_writeb_0, d); register_ioport_read(addr, 4, 1, bmdma_readb_0, d); } else { - register_ioport_write(addr + 1, 3, 1, bmdma_writeb_1, d); + register_ioport_write(addr, 4, 1, bmdma_writeb_1, d); register_ioport_read(addr, 4, 1, bmdma_readb_1, d); } |