Patchwork [1/2,v5] add function DMA_set_return and delete bh_schedule in dma.c

login
register
mail settings
Submitter Zhi Hui Li
Date April 19, 2012, 5:42 a.m.
Message ID <1334814129-26465-1-git-send-email-zhihuili@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/153656/
State New
Headers show

Comments

Zhi Hui Li - April 19, 2012, 5:42 a.m.
add function DMA_set_return and delete bh_schedule in dma.c

Signed-off-by: Li Zhi Hui <zhihuili@linux.vnet.ibm.com>
---
 hw/dma.c |   13 +++++++++++++
 hw/isa.h |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/dma.c b/hw/dma.c
index 0a9322d..55dc320 100644
--- a/hw/dma.c
+++ b/hw/dma.c
@@ -460,6 +460,19 @@  void DMA_schedule(int nchan)
     qemu_irq_pulse(*d->cpu_request_exit);
 }
 
+void DMA_set_return(int nret, int nchan)
+{
+    struct dma_regs *r;
+    struct dma_cont *d;
+    int icont, ichan;
+
+    icont = nchan > 3;
+    ichan = nchan & 3;
+    d = dma_controllers;
+    r = &d[icont].regs[ichan];
+    r->now[COUNT] = nret;
+}
+
 static void dma_reset(void *opaque)
 {
     struct dma_cont *d = opaque;
diff --git a/hw/isa.h b/hw/isa.h
index 40373fb..277f54c 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -92,4 +92,5 @@  void DMA_init(int high_page_enable, qemu_irq *cpu_request_exit);
 void DMA_register_channel (int nchan,
                            DMA_transfer_handler transfer_handler,
                            void *opaque);
+void DMA_set_return(int nret, int nchan);
 #endif