aboutsummaryrefslogtreecommitdiff
path: root/hw/mac_dbdma.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-04 07:20:40 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-04 07:20:40 +0000
commit862c928064cf0f079d81b24db932a093e49d101d (patch)
tree71e0ba8dcf6f5e89b947567c103b6935d55b2e15 /hw/mac_dbdma.c
parent3c4cf5353b25d62795ecafbc88ea67e3ede4196f (diff)
DB-DMA IDE asynchronous I/O
Signed-off-by: Laurent Vivier <Laurent@vivier.eu> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6681 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mac_dbdma.c')
-rw-r--r--hw/mac_dbdma.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/mac_dbdma.c b/hw/mac_dbdma.c
index d6608f6893..8e82a2356c 100644
--- a/hw/mac_dbdma.c
+++ b/hw/mac_dbdma.c
@@ -160,6 +160,7 @@ typedef struct DBDMA_channel {
qemu_irq irq;
DBDMA_io io;
DBDMA_rw rw;
+ DBDMA_flush flush;
dbdma_cmd current;
int processing;
} DBDMA_channel;
@@ -367,7 +368,8 @@ static void dbdma_end(DBDMA_io *io)
current->xfer_status = cpu_to_le16(be32_to_cpu(ch->regs[DBDMA_STATUS]));
current->res_count = cpu_to_le16(be32_to_cpu(io->len));
dbdma_cmdptr_save(ch);
- ch->regs[DBDMA_STATUS] &= cpu_to_be32(~FLUSH);
+ if (io->is_last)
+ ch->regs[DBDMA_STATUS] &= cpu_to_be32(~FLUSH);
conditional_interrupt(ch);
conditional_branch(ch);
@@ -632,7 +634,7 @@ static void DBDMA_run_bh(void *opaque)
}
void DBDMA_register_channel(void *dbdma, int nchan, qemu_irq irq,
- DBDMA_rw rw,
+ DBDMA_rw rw, DBDMA_flush flush,
void *opaque)
{
DBDMA_channel *ch = ( DBDMA_channel *)dbdma + nchan;
@@ -642,6 +644,7 @@ void DBDMA_register_channel(void *dbdma, int nchan, qemu_irq irq,
ch->irq = irq;
ch->channel = nchan;
ch->rw = rw;
+ ch->flush = flush;
ch->io.opaque = opaque;
ch->io.channel = ch;
}
@@ -687,6 +690,8 @@ dbdma_control_write(DBDMA_channel *ch)
if (status & ACTIVE)
qemu_bh_schedule(dbdma_bh);
+ if (status & FLUSH)
+ ch->flush(&ch->io);
}
static void dbdma_writel (void *opaque,