summaryrefslogtreecommitdiffstats
path: root/hw/sb16.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-25 23:32:01 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-25 23:32:01 +0000
commitf9e92e973f4a383a73363ff795a4562c3c6a7c71 (patch)
treedee10fcda3233d82a00a0401c2a2111cda65f9b0 /hw/sb16.c
parent8dc75d7535974b18fb43c514f2699e714b6ce387 (diff)
downloadhqemu-f9e92e973f4a383a73363ff795a4562c3c6a7c71.zip
hqemu-f9e92e973f4a383a73363ff795a4562c3c6a7c71.tar.gz
use physical memory access functions for DMA
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@649 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/sb16.c')
-rw-r--r--hw/sb16.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/hw/sb16.c b/hw/sb16.c
index b04110d..9fbf085 100644
--- a/hw/sb16.c
+++ b/hw/sb16.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <inttypes.h>
+#include "cpu.h"
#include "vl.h"
#define MIN(a, b) ((a)>(b)?(b):(a))
@@ -569,6 +570,7 @@ void SB16_run (void)
static int write_audio (uint32_t addr, int len, int size)
{
int temp, net;
+ uint8_t tmpbuf[4096];
temp = size;
@@ -582,8 +584,10 @@ static int write_audio (uint32_t addr, int len, int size)
left_till_end = len - dsp.dma_pos;
to_copy = MIN (temp, left_till_end);
-
- copied = AUD_write ((void *) (addr + dsp.dma_pos), to_copy);
+ if (to_copy > sizeof(tmpbuf))
+ to_copy = sizeof(tmpbuf);
+ cpu_physical_memory_read(addr + dsp.dma_pos, tmpbuf, to_copy);
+ copied = AUD_write (tmpbuf, to_copy);
temp -= copied;
dsp.dma_pos += copied;
@@ -601,7 +605,7 @@ static int write_audio (uint32_t addr, int len, int size)
return net;
}
-static int SB_read_DMA (uint32_t addr, int size, int *_irq)
+static int SB_read_DMA (void *opaque, target_ulong addr, int size)
{
int free, till, copy, written;
@@ -644,7 +648,7 @@ static int SB_read_DMA (uint32_t addr, int size, int *_irq)
mixer.regs[0x82] |= mixer.regs[0x80];
if (0 == noirq) {
ldebug ("request irq\n");
- *_irq = sb.irq;
+ pic_set_irq(sb.irq, 1);
}
if (0 == dsp.dma_auto) {
@@ -663,11 +667,6 @@ static int SB_read_DMA (uint32_t addr, int size, int *_irq)
return dsp.dma_pos;
}
-static int dma_misc_handler (int moo)
-{
- return -1;
-}
-
static int magic_of_irq (int irq)
{
switch (irq) {
@@ -731,6 +730,6 @@ void SB16_init (void)
register_ioport_read (sb.port + 0x5, 1, mixer_read, 1);
register_ioport_write (sb.port + 0x5, 1, mixer_write_datab, 1);
- DMA_register_channel (sb.hdma, SB_read_DMA, dma_misc_handler);
- DMA_register_channel (sb.dma, SB_read_DMA, dma_misc_handler);
+ DMA_register_channel (sb.hdma, SB_read_DMA, NULL);
+ DMA_register_channel (sb.dma, SB_read_DMA, NULL);
}
OpenPOWER on IntegriCloud