Linux-kernel mailing list archive 1997-48,: Patch for 2.1.68 sound modules.

# Patch for 2.1.68 sound modules.

Niels Kristian Bech Jensen (nkbj@image.dk)
Mon, 1 Dec 1997 07:34:33 +0100 (MET)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Jani Hakala: "Re: 2.1.68: md.c & sound won't compile"
- Previous message: Andreas Schwab: "Re: ar exception in getname?"

Here is the patch Linus suggested for the 2.1.68 sound modules signal
handling.

diff -urN linux-2.1.68/drivers/sound/dmabuf.c linux/drivers/sound/dmabuf.c
--- linux-2.1.68/drivers/sound/dmabuf.c Mon Dec 1 06:04:41 1997
+++ linux/drivers/sound/dmabuf.c Mon Dec 1 06:34:59 1997
@@ -269,7 +269,7 @@
audio_devs[dev]->dmap_out->flags |= DMA_SYNCING;
audio_devs[dev]->dmap_out->underrun_count = 0;
- if (!(current->signal & ~current->blocked)
+ if (!(signal_pending(current))
&& audio_devs[dev]->dmap_out->qlen
&& audio_devs[dev]->dmap_out->underrun_count == 0)
{
@@ -408,7 +408,7 @@
audio_devs[dev]->dmap_out->flags |= DMA_SYNCING;
audio_devs[dev]->dmap_out->underrun_count = 0;
- while (!(current->signal & ~current->blocked)
+ while (!(signal_pending(current))
&& n++ <= audio_devs[dev]->dmap_out->nbufs
&& audio_devs[dev]->dmap_out->qlen
&& audio_devs[dev]->dmap_out->underrun_count == 0)
@@ -448,7 +448,7 @@
cli();
if (audio_devs[dev]->d->local_qlen) /* Device has hidden buffers */
{
- while (!((current->signal & ~current->blocked))
+ while (!(signal_pending(current))
&& audio_devs[dev]->d->local_qlen(dev))
{
@@ -488,7 +488,7 @@
if (audio_devs[dev]->open_mode & OPEN_WRITE)
if (!(audio_devs[dev]->dmap_in->mapping_flags & DMA_MAP_MAPPED))
- if (!((current->signal & ~current->blocked))
+ if (!(signal_pending(current))
&& (audio_devs[dev]->dmap_out->dma_mode == DMODE_OUTPUT))
{
DMAbuf_sync(dev);
@@ -835,7 +835,7 @@
tmout = 20 * HZ;
}
- if ((current->signal & ~current->blocked))
+ if (signal_pending(current))
return -EIO;
@@ -860,7 +860,7 @@
printk("Sound: DMA (output) timed out - IRQ/DRQ config error?\n");
;
dma_reset_output(dev);
- } else if ((current->signal & ~current->blocked))
+ } else if (signal_pending(current))
{
err = -EINTR;
}
diff -urN linux-2.1.68/drivers/sound/dmabuf.c.old linux/drivers/sound/dmabuf.c.old
--- linux-2.1.68/drivers/sound/dmabuf.c.old Sun Nov 30 15:56:51 1997
+++ linux/drivers/sound/dmabuf.c.old Mon Dec 1 06:39:05 1997
@@ -279,7 +279,7 @@
audio_devs[dev]->dmap_out->flags |= DMA_SYNCING;
audio_devs[dev]->dmap_out->underrun_count = 0;
- if (!(current->signal & ~current->blocked)
+ if (!(signal_pending(current))
&& audio_devs[dev]->dmap_out->qlen
&& audio_devs[dev]->dmap_out->underrun_count == 0)
{
@@ -418,7 +418,7 @@
audio_devs[dev]->dmap_out->flags |= DMA_SYNCING;
audio_devs[dev]->dmap_out->underrun_count = 0;
- while (!(current->signal & ~current->blocked)
+ while (!(signal_pending(current))
&& n++ <= audio_devs[dev]->dmap_out->nbufs
&& audio_devs[dev]->dmap_out->qlen
&& audio_devs[dev]->dmap_out->underrun_count == 0)
@@ -458,7 +458,7 @@
cli ();
if (audio_devs[dev]->d->local_qlen) /* Device has hidden buffers */
{
- while (!((current->signal & ~current->blocked))
+ while (!(signal_pending(current))
&& audio_devs[dev]->d->local_qlen (dev))
{
@@ -498,7 +498,7 @@
if (audio_devs[dev]->open_mode & OPEN_WRITE)
if (!(audio_devs[dev]->dmap_in->mapping_flags & DMA_MAP_MAPPED))
- if (!((current->signal & ~current->blocked))
+ if (!(signal_pending(current))
&& (audio_devs[dev]->dmap_out->dma_mode == DMODE_OUTPUT))
{
DMAbuf_sync (dev);
@@ -861,7 +861,7 @@
tmout = 20 * HZ;
}
- if ((current->signal & ~current->blocked))
+ if (signal_pending(current))
return -EIO;
@@ -887,7 +887,7 @@
;
dma_reset_output (dev);
}
- else if ((current->signal & ~current->blocked))
+ else if (signal_pending(current))
{
err = -EINTR;
}
diff -urN linux-2.1.68/drivers/sound/dmasound.c linux/drivers/sound/dmasound.c
--- linux-2.1.68/drivers/sound/dmasound.c Sun Nov 30 15:59:27 1997
+++ linux/drivers/sound/dmasound.c Mon Dec 1 06:40:01 1997
@@ -657,7 +657,7 @@
static struct sound_queue sq;
#define sq_block_address(i) (sq.buffers[i])
-#define SIGNAL_RECEIVED (current->signal & ~current->blocked)
+#define SIGNAL_RECEIVED (signal_pending(current))
#define NON_BLOCKING(open_mode) (open_mode & O_NONBLOCK)
#define ONE_SECOND HZ /* in jiffies (100ths of a second) */
#define NO_TIME_LIMIT 0xffffffff
diff -urN linux-2.1.68/drivers/sound/maui.c linux/drivers/sound/maui.c
--- linux-2.1.68/drivers/sound/maui.c Sun Nov 30 15:59:29 1997
+++ linux/drivers/sound/maui.c Mon Dec 1 06:40:32 1997
@@ -96,7 +96,7 @@
}
maui_sleep_flag.opts &= ~WK_SLEEP;
};
- if ((current->signal & ~current->blocked))
+ if (signal_pending(current))
{
return 0;
}
diff -urN linux-2.1.68/drivers/sound/midi_synth.c linux/drivers/sound/midi_synth.c
--- linux-2.1.68/drivers/sound/midi_synth.c Sun Nov 30 15:59:29 1997
+++ linux/drivers/sound/midi_synth.c Mon Dec 1 06:41:53 1997
@@ -526,7 +526,7 @@
sysex_sleep_flag.opts = WK_NONE;
- for (i = 0; i < left && !(current->signal & ~current->blocked); i++)
+ for (i = 0; i < left && !(signal_pending(current)); i++)
{
unsigned char data;
@@ -546,7 +546,7 @@
}
}
while (!midi_devs[orig_dev]->outputc(orig_dev, (unsigned char) (data & 0xff)) &&
- !(current->signal & ~current->blocked))
+ !(signal_pending(current)))
{
unsigned long tlimit;
diff -urN linux-2.1.68/drivers/sound/midibuf.c linux/drivers/sound/midibuf.c
--- linux-2.1.68/drivers/sound/midibuf.c Sun Nov 30 15:59:29 1997
+++ linux/drivers/sound/midibuf.c Mon Dec 1 06:43:24 1997
@@ -93,7 +93,7 @@
*/
if (midi_devs[dev]->buffer_status != NULL)
- while (!(current->signal & ~current->blocked) &&
+ while (!(signal_pending(current)) &&
midi_devs[dev]->buffer_status(dev))
{
@@ -283,7 +283,7 @@
* devices
*/
- while (!(current->signal & ~current->blocked) &&
+ while (!(signal_pending(current)) &&
DATA_AVAIL(midi_out_buf[dev]))
{
@@ -364,7 +364,7 @@
}
midi_sleep_flag[dev].opts &= ~WK_SLEEP;
};
- if ((current->signal & ~current->blocked))
+ if (signal_pending(current))
{
restore_flags(flags);
return -EINTR;
@@ -421,7 +421,7 @@
}
input_sleep_flag[dev].opts &= ~WK_SLEEP;
};
- if ((current->signal & ~current->blocked))
+ if (signal_pending(current))
c = -EINTR; /*
* The user is getting restless
*/
diff -urN linux-2.1.68/drivers/sound/sequencer.c linux/drivers/sound/sequencer.c
--- linux-2.1.68/drivers/sound/sequencer.c Sun Nov 30 15:59:31 1997
+++ linux/drivers/sound/sequencer.c Mon Dec 1 06:45:25 1997
@@ -1219,7 +1219,7 @@
n = 1;
- while (!(current->signal & ~current->blocked) && n)
+ while (!(signal_pending(current)) && n)
{
n = 0;
@@ -1271,7 +1271,7 @@
if (mode != OPEN_READ && !(file->flags & (O_NONBLOCK) ?
1 : 0))
- while (!(current->signal & ~current->blocked) && qlen > 0)
+ while (!(signal_pending(current)) && qlen > 0)
{
seq_sync();
@@ -1335,7 +1335,7 @@
{
unsigned long flags;
- if (qlen && !seq_playing && !(current->signal & ~current->blocked))
+ if (qlen && !seq_playing && !(signal_pending(current)))
seq_startplay();
save_flags(flags);
@@ -1563,7 +1563,7 @@
if (mode == OPEN_READ)
return 0;
- while (qlen > 0 && !(current->signal & ~current->blocked))
+ while (qlen > 0 && !(signal_pending(current)))
seq_sync();
if (qlen)
return -EINTR;

    --
    Med venlig hilsen / Best regards
                                                                   nkbj@image.dk
    Niels Kristian Bech Jensen                        http://www.image.dk/~nkbj/

- Next message: Jani Hakala: "Re: 2.1.68: md.c & sound won't compile"
- Previous message: Andreas Schwab: "Re: ar exception in getname?"