From: Ian Jackson Date: Wed, 14 May 2008 15:51:53 +0000 (+0100) Subject: dma.c merged from xen-unstable 17318:b5fea3aeb04b X-Git-Tag: xen-3.3.0-rc1~189 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3984b1615f4df14b3d226a390ab0e49ceb067681;p=qemu-xen-4.4-testing.git dma.c merged from xen-unstable 17318:b5fea3aeb04b changesets included: changeset: 14912:c1d3f4fbfacf7ea8eab9549823787f13efa2d976 user: Christian Limpach date: Tue Apr 24 17:02:10 2007 +0100 files: tools/ioemu/hw/dma.c description: [qemu-dm] Check for null pointer in dma handler function pointer. Signed-off-by: Christian Limpach changeset: 16936:3daab9b636c121bc9d957568ea135b2f40776ca5 user: Keir Fraser date: Wed Jan 30 09:33:26 2008 +0000 files: tools/ioemu/hw/dma.c tools/ioemu/hw/sb16.c description: ioemu: Better fix for SB16 infinite looping. Qemu upstream solves "Fix an infinite loop in the emulated SB16 device" issue differently as stated in [2] [1] http://xenbits.xensource.com/xen-3.1-testing.hg?rev/4b22d472bda6 [2] http://lists.gnu.org/archive/html/qemu-devel/2008-01/msg00709.html Signed-off-by: S. Caglar Onur --- diff --git a/hw/dma.c b/hw/dma.c index f192c63d1..433ac3d9d 100644 --- a/hw/dma.c +++ b/hw/dma.c @@ -341,6 +341,8 @@ static void channel_run (int ncont, int ichan) #endif r = dma_controllers[ncont].regs + ichan; + if (r->transfer_handler == NULL) + return; n = r->transfer_handler (r->opaque, ichan + (ncont << 2), r->now[COUNT], (r->base[COUNT] + 1) << ncont); r->now[COUNT] = n; @@ -446,6 +448,13 @@ static int dma_phony_handler (void *opaque, int nchan, int dma_pos, int dma_len) return dma_pos; } +static int dma_phony_handler (void *opaque, int nchan, int dma_pos, int dma_len) +{ + dolog ("unregistered DMA channel used nchan=%d dma_pos=%d dma_len=%d\n", + nchan, dma_pos, dma_len); + return dma_pos; +} + /* dshift = 0: 8 bit DMA, 1 = 16 bit DMA */ static void dma_init2(struct dma_cont *d, int base, int dshift, int page_base, int pageh_base)