aboutsummaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/sound/dmabuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/isa/sound/dmabuf.c')
-rw-r--r--sys/i386/isa/sound/dmabuf.c360
1 files changed, 234 insertions, 126 deletions
diff --git a/sys/i386/isa/sound/dmabuf.c b/sys/i386/isa/sound/dmabuf.c
index ace02d149a41..851a70a16b1b 100644
--- a/sys/i386/isa/sound/dmabuf.c
+++ b/sys/i386/isa/sound/dmabuf.c
@@ -1,10 +1,10 @@
/*
- * linux/kernel/chr_drv/sound/dmabuf.c
- *
+ * sound/dmabuf.c
+ *
* The DMA buffer manager for digitized voice applications
- *
+ *
* Copyright by Hannu Savolainen 1993
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: 1. Redistributions of source code must retain the above copyright
@@ -12,7 +12,7 @@
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -24,7 +24,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
*/
#include "sound_config.h"
@@ -35,7 +35,7 @@
#if !defined(EXCLUDE_AUDIO) || !defined(EXCLUDE_GUS)
-#define MAX_SUB_BUFFERS 16
+#define MAX_SUB_BUFFERS (32*MAX_REALTIME_FACTOR)
/*
* The DSP channel can be used either for input or output. Variable
@@ -48,7 +48,6 @@
#define DMODE_NONE 0
#define DMODE_OUTPUT 1
#define DMODE_INPUT 2
-#define DMODE_INIT 3
DEFINE_WAIT_QUEUES (dev_sleeper[MAX_DSP_DEV], dev_sleep_flag[MAX_DSP_DEV]);
@@ -58,22 +57,6 @@ static int dma_mode[MAX_DSP_DEV] =
static volatile int dmabuf_interrupted[MAX_DSP_DEV] =
{0};
-#ifdef ISC
-/* I don't like this. */
-#undef INTERRUPTIBLE_SLEEP_ON
-#define INTERRUPTIBLE_SLEEP_ON(A,F) { \
- A = F = 1; \
- if (sleep(&(A), (PZERO + 5) | PCATCH)) { \
- A = F = 0; \
- dmabuf_interrupted[dev] = 1; \
- dev_busy[dev] = 0; \
- dma_reset(dev); \
- dmabuf_interrupted[dev] = 0; \
- /* longjmp(u.u_qsav, 1); Where it goes??? */ \
- } \
- }
-#endif
-
/*
* Pointers to raw buffers
*/
@@ -89,7 +72,10 @@ int snd_raw_count[MAX_DSP_DEV];
*/
static int dev_busy[MAX_DSP_DEV];
+static int dev_needs_restart[MAX_DSP_DEV];
+static int dev_modes[MAX_DSP_DEV];
static int dev_active[MAX_DSP_DEV];
+static int dev_started[MAX_DSP_DEV];
static int dev_qlen[MAX_DSP_DEV];
static int dev_qhead[MAX_DSP_DEV];
static int dev_qtail[MAX_DSP_DEV];
@@ -102,8 +88,10 @@ static int bufferalloc_done[MAX_DSP_DEV] =
*/
static int dev_nbufs[MAX_DSP_DEV]; /* # of logical buffers ( >=
- * sound_buffcounts[dev] */
+
+ * sound_buffcounts[dev] */
static int dev_counts[MAX_DSP_DEV][MAX_SUB_BUFFERS];
+static int dev_subdivision[MAX_DSP_DEV];
static unsigned long dev_buf_phys[MAX_DSP_DEV][MAX_SUB_BUFFERS];
static char *dev_buf[MAX_DSP_DEV][MAX_SUB_BUFFERS] =
{
@@ -117,8 +105,8 @@ reorganize_buffers (int dev)
* This routine breaks the physical device buffers to logical ones.
*/
- unsigned long i, p, n;
- unsigned long sr, nc, sz, bsz;
+ unsigned i, p, n;
+ unsigned sr, nc, sz, bsz;
sr = dsp_devs[dev]->ioctl (dev, SOUND_PCM_READ_RATE, 0, 1);
nc = dsp_devs[dev]->ioctl (dev, SOUND_PCM_READ_CHANNELS, 0, 1);
@@ -148,6 +136,17 @@ reorganize_buffers (int dev)
if (sound_buffcounts[dev] == 1 && bsz == sound_buffsizes[dev])
bsz >>= 1; /* Need at least 2 buffers */
+ if (dev_subdivision[dev] == 0)
+ dev_subdivision[dev] = 1; /* Default value */
+
+ bsz /= dev_subdivision[dev]; /* Use smaller buffers */
+
+ if (bsz == 0)
+ bsz = 4096; /* Just a sanity check */
+
+ while ((sound_buffsizes[dev] * sound_buffcounts[dev]) / bsz > MAX_SUB_BUFFERS)
+ bsz <<= 1; /* Too much buffers */
+
dev_buffsize[dev] = bsz;
n = 0;
@@ -178,6 +177,21 @@ reorganize_buffers (int dev)
bufferalloc_done[dev] = 1;
}
+static void
+dma_init_buffers (int dev)
+{
+ RESET_WAIT_QUEUE (dev_sleeper[dev], dev_sleep_flag[dev]);
+ dev_underrun[dev] = 0;
+
+ dev_busy[dev] = 1;
+
+ bufferalloc_done[dev] = 0;
+
+ dev_active[dev] = dev_qlen[dev] = dev_qtail[dev] = dev_qhead[dev] = 0;
+ dev_needs_restart[dev] = dev_started[dev] = 0;
+ dma_mode[dev] = DMODE_NONE;
+}
+
int
DMAbuf_open (int dev, int mode)
{
@@ -198,20 +212,23 @@ DMAbuf_open (int dev, int mode)
return RET_ERROR (ENXIO);
}
+#ifdef USE_RUNTIME_DMAMEM
+ sound_dma_malloc (dev);
+#endif
+
if (snd_raw_buf[dev][0] == NULL)
return RET_ERROR (ENOSPC); /* Memory allocation failed during boot */
if ((retval = dsp_devs[dev]->open (dev, mode)) < 0)
return retval;
- dev_underrun[dev] = 0;
-
- dev_busy[dev] = 1;
+ dev_modes[dev] = mode;
+ dev_subdivision[dev] = 0;
- reorganize_buffers (dev);
- bufferalloc_done[dev] = 0;
-
- dev_qlen[dev] = dev_qtail[dev] = dev_qhead[dev] = 0;
+ dma_init_buffers (dev);
+ dsp_devs[dev]->ioctl (dev, SOUND_PCM_WRITE_BITS, 8, 1);
+ dsp_devs[dev]->ioctl (dev, SOUND_PCM_WRITE_CHANNELS, 1, 1);
+ dsp_devs[dev]->ioctl (dev, SOUND_PCM_WRITE_RATE, DSP_DEFAULT_SPEED, 1);
return 0;
}
@@ -219,35 +236,37 @@ DMAbuf_open (int dev, int mode)
static void
dma_reset (int dev)
{
+ int retval;
+ unsigned long flags;
+
+ DISABLE_INTR (flags);
dsp_devs[dev]->reset (dev);
+ dsp_devs[dev]->close (dev);
- dev_qlen[dev] = 0;
- dev_qhead[dev] = 0;
- dev_qtail[dev] = 0;
- dev_active[dev] = 0;
+ if ((retval = dsp_devs[dev]->open (dev, dev_modes[dev])) < 0)
+ printk ("Sound: Reset failed - Can't reopen device\n");
+ RESTORE_INTR (flags);
+
+ dma_init_buffers (dev);
+ reorganize_buffers (dev);
}
static int
dma_sync (int dev)
{
unsigned long flags;
- unsigned long time;
- int timed_out;
if (dma_mode[dev] == DMODE_OUTPUT)
{
DISABLE_INTR (flags);
- timed_out = 0;
- time = GET_TIME ();
-
- while ((!(PROCESS_ABORTING || dmabuf_interrupted[dev]) && !timed_out)
+ while ((!(PROCESS_ABORTING (dev_sleeper[dev], dev_sleep_flag[dev]) ||
+ dmabuf_interrupted[dev]))
&& dev_qlen[dev])
{
- REQUEST_TIMEOUT (10 * HZ, dev_sleeper[dev]);
- INTERRUPTIBLE_SLEEP_ON (dev_sleeper[dev], dev_sleep_flag[dev]);
- if ((GET_TIME () - time) > (10 * HZ))
- timed_out = 1;
+ DO_SLEEP (dev_sleeper[dev], dev_sleep_flag[dev], 10 * HZ);
+ if (TIMED_OUT (dev_sleeper[dev], dev_sleep_flag[dev]))
+ return dev_qlen[dev];
}
RESTORE_INTR (flags);
@@ -259,11 +278,11 @@ dma_sync (int dev)
DISABLE_INTR (flags);
if (dsp_devs[dev]->has_output_drained) /* Device has hidden buffers */
{
- while (!(PROCESS_ABORTING || dmabuf_interrupted[dev])
+ while (!(PROCESS_ABORTING (dev_sleeper[dev], dev_sleep_flag[dev]) ||
+ dmabuf_interrupted[dev])
&& !dsp_devs[dev]->has_output_drained (dev))
{
- REQUEST_TIMEOUT (HZ / 4, dev_sleeper[dev]);
- INTERRUPTIBLE_SLEEP_ON (dev_sleeper[dev], dev_sleep_flag[dev]);
+ DO_SLEEP (dev_sleeper[dev], dev_sleep_flag[dev], HZ / 4);
}
}
RESTORE_INTR (flags);
@@ -275,16 +294,20 @@ int
DMAbuf_release (int dev, int mode)
{
- if (!(PROCESS_ABORTING || dmabuf_interrupted[dev])
+ if (!(PROCESS_ABORTING (dev_sleeper[dev], dev_sleep_flag[dev]) ||
+ dmabuf_interrupted[dev])
&& (dma_mode[dev] == DMODE_OUTPUT))
{
dma_sync (dev);
}
- dma_reset (dev);
+#ifdef USE_RUNTIME_DMAMEM
+ sound_dma_free (dev);
+#endif
- if (!dev_active[dev])
- dsp_devs[dev]->close (dev);
+ dsp_devs[dev]->reset (dev);
+
+ dsp_devs[dev]->close (dev);
dma_mode[dev] = DMODE_NONE;
dev_busy[dev] = 0;
@@ -296,40 +319,65 @@ int
DMAbuf_getrdbuffer (int dev, char **buf, int *len)
{
unsigned long flags;
+ int err = EIO;
- if (!bufferalloc_done[dev])
- reorganize_buffers (dev);
-
- if (!dma_mode[dev])
+ DISABLE_INTR (flags);
+ if (!dev_qlen[dev])
{
- int err;
+ if (dev_needs_restart[dev])
+ {
+ dma_reset (dev);
+ dev_needs_restart[dev] = 0;
+ }
- if ((err = dsp_devs[dev]->prepare_for_input (dev,
- dev_buffsize[dev], dev_nbufs[dev])) < 0)
- return err;
- dma_mode[dev] = DMODE_INPUT;
- }
+ if (dma_mode[dev] == DMODE_OUTPUT) /* Was output -> direction change */
+ {
+ dma_sync (dev);
+ dma_reset (dev);
+ dma_mode[dev] = DMODE_NONE;
+ }
- if (dma_mode[dev] != DMODE_INPUT)
- return RET_ERROR (EBUSY); /* Can't change mode on fly */
+ if (!bufferalloc_done[dev])
+ reorganize_buffers (dev);
+
+ if (!dma_mode[dev])
+ {
+ int err;
+
+ if ((err = dsp_devs[dev]->prepare_for_input (dev,
+ dev_buffsize[dev], dev_nbufs[dev])) < 0)
+ {
+ RESTORE_INTR (flags);
+ return err;
+ }
+ dma_mode[dev] = DMODE_INPUT;
+ }
- DISABLE_INTR (flags);
- if (!dev_qlen[dev])
- {
if (!dev_active[dev])
{
- dsp_devs[dev]->start_input (dev, dev_buf_phys[dev][dev_qtail[dev]], dev_buffsize[dev], 0);
+ dsp_devs[dev]->start_input (dev, dev_buf_phys[dev][dev_qtail[dev]],
+ dev_buffsize[dev], 0,
+ !sound_dma_automode[dev] ||
+ !dev_started[dev]);
dev_active[dev] = 1;
+ dev_started[dev] = 1;
}
/* Wait for the next block */
- REQUEST_TIMEOUT (10 * HZ, dev_sleeper[dev]);
- INTERRUPTIBLE_SLEEP_ON (dev_sleeper[dev], dev_sleep_flag[dev]);
+ DO_SLEEP (dev_sleeper[dev], dev_sleep_flag[dev], 2 * HZ);
+ if (TIMED_OUT (dev_sleeper[dev], dev_sleep_flag[dev]))
+ {
+ printk ("Sound: DMA timed out - IRQ/DRQ config error?\n");
+ err = EIO;
+ SET_ABORT_FLAG (dev_sleeper[dev], dev_sleep_flag[dev]);
+ }
+ else
+ err = EINTR;
}
RESTORE_INTR (flags);
if (!dev_qlen[dev])
- return RET_ERROR (EINTR);
+ return RET_ERROR (err);
*buf = &dev_buf[dev][dev_qhead[dev]][dev_counts[dev][dev_qhead[dev]]];
*len = dev_buffsize[dev] - dev_counts[dev][dev_qhead[dev]];
@@ -391,6 +439,7 @@ DMAbuf_ioctl (int dev, unsigned int cmd, unsigned int arg, int local)
case SNDCTL_DSP_SYNC:
dma_sync (dev);
+ dma_reset (dev);
return 0;
break;
@@ -401,10 +450,37 @@ DMAbuf_ioctl (int dev, unsigned int cmd, unsigned int arg, int local)
return IOCTL_OUT (arg, dev_buffsize[dev]);
break;
+ case SNDCTL_DSP_SUBDIVIDE:
+ {
+ int fact = IOCTL_IN (arg);
+
+ if (fact == 0)
+ {
+ fact = dev_subdivision[dev];
+ if (fact == 0)
+ fact = 1;
+ return IOCTL_OUT (arg, fact);
+ }
+
+ if (dev_subdivision[dev] != 0) /* Too late to change */
+ return RET_ERROR (EINVAL);
+
+ if (fact > MAX_REALTIME_FACTOR)
+ return RET_ERROR (EINVAL);
+
+ if (fact != 1 && fact != 2 && fact != 4 && fact != 8 && fact != 16)
+ return RET_ERROR (EINVAL);
+
+ dev_subdivision[dev] = fact;
+ return IOCTL_OUT (arg, fact);
+ }
+ break;
+
default:
return dsp_devs[dev]->ioctl (dev, cmd, arg, local);
}
+ /* NOTREACHED */
return RET_ERROR (EIO);
}
@@ -412,6 +488,20 @@ int
DMAbuf_getwrbuffer (int dev, char **buf, int *size)
{
unsigned long flags;
+ int err = EIO;
+
+ if (dma_mode[dev] == DMODE_INPUT) /* Was input -> Direction change */
+ {
+ dma_reset (dev);
+ dma_mode[dev] = DMODE_NONE;
+ }
+ else if (dev_needs_restart[dev]) /* Restart buffering */
+ {
+ dma_sync (dev);
+ dma_reset (dev);
+ }
+
+ dev_needs_restart[dev] = 0;
if (!bufferalloc_done[dev])
reorganize_buffers (dev);
@@ -426,10 +516,11 @@ DMAbuf_getwrbuffer (int dev, char **buf, int *size)
return err;
}
- if (dma_mode[dev] != DMODE_OUTPUT)
- return RET_ERROR (EBUSY); /* Can't change mode on fly */
DISABLE_INTR (flags);
+
+ RESET_WAIT_QUEUE (dev_sleeper[dev], dev_sleep_flag[dev]);
+
if (dev_qlen[dev] == dev_nbufs[dev])
{
if (!dev_active[dev])
@@ -440,14 +531,20 @@ DMAbuf_getwrbuffer (int dev, char **buf, int *size)
}
/* Wait for free space */
- REQUEST_TIMEOUT (60 * HZ, dev_sleeper[dev]); /* GUS requires up to 60
- * sec */
- INTERRUPTIBLE_SLEEP_ON (dev_sleeper[dev], dev_sleep_flag[dev]);
+ DO_SLEEP (dev_sleeper[dev], dev_sleep_flag[dev], 2 * HZ);
+ if (TIMED_OUT (dev_sleeper[dev], dev_sleep_flag[dev]))
+ {
+ printk ("Sound: DMA timed out - IRQ/DRQ config error?\n");
+ err = EIO;
+ SET_ABORT_FLAG (dev_sleeper[dev], dev_sleep_flag[dev]);
+ }
+ else if (PROCESS_ABORTING (dev_sleeper[dev], dev_sleep_flag[dev]))
+ err = EINTR;
}
RESTORE_INTR (flags);
if (dev_qlen[dev] == dev_nbufs[dev])
- return RET_ERROR (EIO); /* We have got signal (?) */
+ return RET_ERROR (err); /* We have got signal (?) */
*buf = dev_buf[dev][dev_qtail[dev]];
*size = dev_buffsize[dev];
@@ -466,12 +563,18 @@ DMAbuf_start_output (int dev, int buff_no, int l)
dev_counts[dev][dev_qtail[dev]] = l;
+ dev_needs_restart[dev] = (l != dev_buffsize[dev]) &&
+ (sound_dma_automode[dev] || dsp_devs[dev]->flags & NEEDS_RESTART);
+
dev_qtail[dev] = (dev_qtail[dev] + 1) % dev_nbufs[dev];
if (!dev_active[dev])
{
dev_active[dev] = 1;
- dsp_devs[dev]->output_block (dev, dev_buf_phys[dev][dev_qhead[dev]], dev_counts[dev][dev_qhead[dev]], 0);
+ dsp_devs[dev]->output_block (dev, dev_buf_phys[dev][dev_qhead[dev]],
+ dev_counts[dev][dev_qhead[dev]], 0,
+ !sound_dma_automode[dev] || !dev_started[dev]);
+ dev_started[dev] = 1;
}
return 0;
@@ -504,27 +607,33 @@ DMAbuf_start_dma (int dev, unsigned long physaddr, int count, int dma_mode)
set_dma_count (chan, sound_buffsizes[dev]);
enable_dma (chan);
RESTORE_INTR (flags);
-#else
+#else /* linux */
#ifdef __386BSD__
printk ("sound: Invalid DMA mode for device %d\n", dev);
isa_dmastart ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE,
(caddr_t)snd_raw_buf_phys[dev][0],
- (unsigned)sound_buffsizes[dev],
- (unsigned)chan);
-#else
-#ifdef ISC
+ sound_buffsizes[dev],
+ chan);
+#else /* __386BSD__ */
+#if defined(ISC) || defined(SCO) || defined(SVR42)
+#ifndef DMAMODE_AUTO
printk ("sound: Invalid DMA mode for device %d\n", dev);
- dma_param (chan, ((dma_mode == DMA_MODE_READ) ? DMA_Rdmode : DMA_Wrmode) | DMAMODE_AUTO,
- snd_raw_buf_phys[dev][0], count - 1);
+#endif /* DMAMODE_AUTO */
+ dma_param (chan, ((dma_mode == DMA_MODE_READ) ? DMA_Rdmode : DMA_Wrmode)
+#ifdef DMAMODE_AUTO
+ | DMAMODE_AUTO
+#endif /* DMAMODE_AUTO */
+ ,
+ snd_raw_buf_phys[dev][0], count);
dma_enable (chan);
-#else
-# error This routine is not valid for this OS.
-#endif
-#endif
+#else /* SYSV */
+#error This routine is not valid for this OS.
+#endif /* SYSV */
+#endif /* __386BSD__ */
-#endif
+#endif /* linux */
}
else
{
@@ -537,24 +646,24 @@ DMAbuf_start_dma (int dev, unsigned long physaddr, int count, int dma_mode)
set_dma_count (chan, count);
enable_dma (chan);
RESTORE_INTR (flags);
-#else
+#else /* linux */
#ifdef __386BSD__
isa_dmastart ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE,
(caddr_t)physaddr,
count,
chan);
-#else
+#else /* __386BSD__ */
-#ifdef ISC
+#if defined(ISC) || defined(SCO) || defined(SVR42)
dma_param (chan, ((dma_mode == DMA_MODE_READ) ? DMA_Rdmode : DMA_Wrmode),
- physaddr, count - 1);
+ physaddr, count);
dma_enable (chan);
-#else
-# error This routine is not valid for this OS.
-#endif /* !ISC */
-#endif
+#else /* SYSV */
+#error This routine is not valid for this OS.
+#endif /* SYSV */
+#endif /* __386BSD__ */
-#endif
+#endif /* linux */
}
return count;
@@ -584,37 +693,33 @@ DMAbuf_init (long mem_start)
}
void
-DMAbuf_outputintr (int dev)
+DMAbuf_outputintr (int dev, int underrun_flag)
{
unsigned long flags;
- dev_active[dev] = 0;
dev_qlen[dev]--;
dev_qhead[dev] = (dev_qhead[dev] + 1) % dev_nbufs[dev];
+ dev_active[dev] = 0;
if (dev_qlen[dev])
{
- dsp_devs[dev]->output_block (dev, dev_buf_phys[dev][dev_qhead[dev]], dev_counts[dev][dev_qhead[dev]], 1);
+ dsp_devs[dev]->output_block (dev, dev_buf_phys[dev][dev_qhead[dev]],
+ dev_counts[dev][dev_qhead[dev]], 1,
+ !sound_dma_automode[dev]);
dev_active[dev] = 1;
}
- else
+ else if (underrun_flag)
{
- if (dev_busy[dev])
- {
- dev_underrun[dev]++;
- dsp_devs[dev]->halt_xfer (dev);
- }
- else
- { /* Device has been closed */
- dsp_devs[dev]->close (dev);
- }
+ dev_underrun[dev]++;
+ dsp_devs[dev]->halt_xfer (dev);
+ dev_needs_restart[dev] = (sound_dma_automode[dev] ||
+ dsp_devs[dev]->flags & NEEDS_RESTART);
}
DISABLE_INTR (flags);
- if (dev_sleep_flag[dev])
+ if (SOMEONE_WAITING (dev_sleeper[dev], dev_sleep_flag[dev]))
{
- dev_sleep_flag[dev] = 0;
- WAKE_UP (dev_sleeper[dev]);
+ WAKE_UP (dev_sleeper[dev], dev_sleep_flag[dev]);
}
RESTORE_INTR (flags);
}
@@ -624,30 +729,33 @@ DMAbuf_inputintr (int dev)
{
unsigned long flags;
- dev_active[dev] = 0;
if (!dev_busy[dev])
{
dsp_devs[dev]->close (dev);
}
else if (dev_qlen[dev] == (dev_nbufs[dev] - 1))
{
+ printk ("Sound: Recording overrun\n");
dev_underrun[dev]++;
dsp_devs[dev]->halt_xfer (dev);
+ dev_active[dev] = 0;
+ dev_needs_restart[dev] = sound_dma_automode[dev];
}
else
{
dev_qlen[dev]++;
dev_qtail[dev] = (dev_qtail[dev] + 1) % dev_nbufs[dev];
- dsp_devs[dev]->start_input (dev, dev_buf_phys[dev][dev_qtail[dev]], dev_buffsize[dev], 1);
+ dsp_devs[dev]->start_input (dev, dev_buf_phys[dev][dev_qtail[dev]],
+ dev_buffsize[dev], 1,
+ !sound_dma_automode[dev]);
dev_active[dev] = 1;
}
DISABLE_INTR (flags);
- if (dev_sleep_flag[dev])
+ if (SOMEONE_WAITING (dev_sleeper[dev], dev_sleep_flag[dev]))
{
- dev_sleep_flag[dev] = 0;
- WAKE_UP (dev_sleeper[dev]);
+ WAKE_UP (dev_sleeper[dev], dev_sleep_flag[dev]);
}
RESTORE_INTR (flags);
}
@@ -691,13 +799,13 @@ DMAbuf_reset_dma (int chan)
/*
* The sound_mem_init() is called by mem_init() immediately after mem_map is
* initialized and before free_page_list is created.
- *
+ *
* This routine allocates DMA buffers at the end of available physical memory (
* <16M) and marks pages reserved at mem_map.
*/
#else
-/* Stub versions if audio services not included */
+/* Stub versions if audio services not included */
int
DMAbuf_open (int dev, int mode)
@@ -784,7 +892,7 @@ DMAbuf_inputintr (int dev)
}
void
-DMAbuf_outputintr (int dev)
+DMAbuf_outputintr (int dev, int underrun_flag)
{
return;
}