summaryrefslogtreecommitdiff
path: root/hw/ide/piix.c
diff options
context:
space:
mode:
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>2009-12-13 19:03:31 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-12-13 19:03:31 +0000
commit90228ee395b71cdd64e6bc844e3d553eb9ef643f (patch)
treec4b15718360671879c9e39bf9ebc92d728023c21 /hw/ide/piix.c
parentcf708987d7df69a5c72db8ba587e448a1bd02587 (diff)
downloadqemu-90228ee395b71cdd64e6bc844e3d553eb9ef643f.tar.gz
workaround for cmd646 bmdma register access while no dma is active
This is a workaround only, and is a partial revert of a few changes to BMDMAState which removed pci_dev field on the way. - cmd646 pci_from_bm() expects bm->unit value to correspond with bm data being passed to callback as opaque pointer. This breaks when write to dma control register of second channel happens when no dma operation is in progress, so bm->unit is zero for second channel, and pci_from_bm() returns garbage pointer. Crash happens shortly after that while dereferencing that pointer. v0->v1: cleaned up dead code from pci_from_bm. Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/ide/piix.c')
-rw-r--r--hw/ide/piix.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index de3648023e..2776ac3650 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -78,6 +78,7 @@ static void bmdma_map(PCIDevice *pci_dev, int region_num,
BMDMAState *bm = &d->bmdma[i];
d->bus[i].bmdma = bm;
bm->bus = d->bus+i;
+ bm->pci_dev = d;
qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm);
register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm);