提交 b76876e6 编写于 作者: K Kevin Wolf

ide: Reset current_addr after stopping DMA

Whenever SSBM is reset in the command register all state information is lost.
Restarting DMA means that current_addr must be reset to the base address of the
PRD table. The OS is not required to change the base address register before
starting a DMA operation, it can reuse the value it wrote for an earlier
request.
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
Reviewed-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
上级 c29947bb
...@@ -65,6 +65,7 @@ void bmdma_cmd_writeb(void *opaque, uint32_t addr, uint32_t val) ...@@ -65,6 +65,7 @@ void bmdma_cmd_writeb(void *opaque, uint32_t addr, uint32_t val)
#endif #endif
} }
} else { } else {
bm->cur_addr = bm->addr;
if (!(bm->status & BM_STATUS_DMAING)) { if (!(bm->status & BM_STATUS_DMAING)) {
bm->status |= BM_STATUS_DMAING; bm->status |= BM_STATUS_DMAING;
/* start dma transfer if possible */ /* start dma transfer if possible */
...@@ -101,7 +102,6 @@ static void bmdma_addr_write(IORange *ioport, uint64_t addr, ...@@ -101,7 +102,6 @@ static void bmdma_addr_write(IORange *ioport, uint64_t addr,
#endif #endif
bm->addr &= ~(mask << shift); bm->addr &= ~(mask << shift);
bm->addr |= ((data & mask) << shift) & ~3; bm->addr |= ((data & mask) << shift) & ~3;
bm->cur_addr = bm->addr;
} }
const IORangeOps bmdma_addr_ioport_ops = { const IORangeOps bmdma_addr_ioport_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册