aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-01-14 04:24:29 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-01-14 04:24:29 +0000
commitca9cc28c62a2c2877186569f4ab0cf1034502a73 (patch)
treed46c878d8f03c294452d625c851d6bb3668c5087 /hw
parentb34d259a81500d75e4cf435f1e8b262ba7e1421a (diff)
pthreads-based audio and miscellaneous audio clean-up (malc).
ESD support (malc, Frederick Reeve). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3917 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/dma.c10
-rw-r--r--hw/sb16.c6
2 files changed, 16 insertions, 0 deletions
diff --git a/hw/dma.c b/hw/dma.c
index 1891b2278c..f192c63d1e 100644
--- a/hw/dma.c
+++ b/hw/dma.c
@@ -439,6 +439,13 @@ static void dma_reset(void *opaque)
write_cont (d, (0x0d << d->dshift), 0);
}
+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)
@@ -471,6 +478,9 @@ static void dma_init2(struct dma_cont *d, int base, int dshift,
}
qemu_register_reset(dma_reset, d);
dma_reset(d);
+ for (i = 0; i < LENOFA (d->regs); ++i) {
+ d->regs[i].transfer_handler = dma_phony_handler;
+ }
}
static void dma_save (QEMUFile *f, void *opaque)
diff --git a/hw/sb16.c b/hw/sb16.c
index effbfbcf8d..c22de7a715 100644
--- a/hw/sb16.c
+++ b/hw/sb16.c
@@ -1193,6 +1193,12 @@ static int SB_read_DMA (void *opaque, int nchan, int dma_pos, int dma_len)
SB16State *s = opaque;
int till, copy, written, free;
+ if (s->block_size <= 0) {
+ dolog ("invalid block size=%d nchan=%d dma_pos=%d dma_len=%d\n",
+ s->block_size, nchan, dma_pos, dma_len);
+ return dma_pos;
+ }
+
if (s->left_till_irq < 0) {
s->left_till_irq = s->block_size;
}