Skip to contentSkip to conversation

DMA emulation fix

PATCH New J. Mayer 1 participant 1 message Nov 13, 2003

lore
Share & tools
lore

J. Mayer

author
#0 lore raw

PATCH 1/1 DMA emulation fix

This patch fixes DMA transfer mode command and debug messages.
Index: dma.c
===================================================================
RCS file: /cvsroot/qemu/qemu/dma.c,v
retrieving revision 1.1

dma.c +8 -7
diff -u -d -w -B -b -d -p -r1.1 dma.c
@@ -28,6 +28,7 @@
 #include "vl.h"
 #include "cpu.h"
 
+//#define DEBUG_DMA
 #define log(...) fprintf (stderr, "dma: " __VA_ARGS__)
 #ifdef DEBUG_DMA
 #define lwarn(...) fprintf (stderr, "dma: " __VA_ARGS__)
@@ -215,17 +216,17 @@ static void write_cont (struct CPUX86Sta
 
     case 0xb:                   /* mode */
         {
-#ifdef DMA_DEBUG
+            ichan = data & 3;
+#ifdef DEBUG_DMA
             int op;
             int ai;
             int dir;
             int opmode;
 
-            ichan = val & 3;
-            op = (val >> 2) & 3;
-            ai = (val >> 4) & 1;
-            dir = (val >> 5) & 1;
-            opmode = (val >> 6) & 3;
+            op = (data >> 2) & 3;
+            ai = (data >> 4) & 1;
+            dir = (data >> 5) & 1;
+            opmode = (data >> 6) & 3;
 
             linfo ("ichan %d, op %d, ai %d, dir %d, opmode %d\n",
                    ichan, op, ai, dir, opmode);
@@ -259,7 +259,7 @@ static void write_cont (struct CPUX86Sta
         goto error;
     }
 
-#ifdef DMA_DEBUG
+#ifdef DEBUG_DMA
     if (0xc != iport) {
         linfo ("nport %#06x, ncont %d, ichan % 2d, val %#06x\n",
                nport, d != dma_controllers, ichan, data);

Please apply...

Signature · 2 lines
J. Mayer <[email protected]>
Never organized