Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
23e6718a
Commit
23e6718a
authored
Aug 29, 2002
by
Peter Wächtler
Committed by
Linus Torvalds
Aug 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] oss/pas2_pcm.c - convert cli to spinlocks
parent
c5034025
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
sound/oss/pas2_pcm.c
sound/oss/pas2_pcm.c
+16
-19
No files found.
sound/oss/pas2_pcm.c
View file @
23e6718a
...
...
@@ -16,6 +16,7 @@
*/
#include <linux/init.h>
#include <linux/spinlock.h>
#include "sound_config.h"
#include "pas2.h"
...
...
@@ -44,6 +45,8 @@ static int pcm_busy = 0;
int
pas_audiodev
=
-
1
;
static
int
open_mode
=
0
;
extern
spinlock_t
lock
;
static
int
pcm_set_speed
(
int
arg
)
{
int
foo
,
tmp
;
...
...
@@ -101,8 +104,7 @@ static int pcm_set_speed(int arg)
pcm_filter
=
tmp
;
#endif
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
lock
,
flags
);
pas_write
(
tmp
&
~
(
0x40
|
0x80
),
0x0B8A
);
pas_write
(
0x00
|
0x30
|
0x04
,
0x138B
);
...
...
@@ -110,7 +112,7 @@ static int pcm_set_speed(int arg)
pas_write
((
foo
>>
8
)
&
0xff
,
0x1388
);
pas_write
(
tmp
,
0x0B8A
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
return
pcm_speed
;
}
...
...
@@ -212,15 +214,14 @@ static int pas_audio_open(int dev, int mode)
DEB
(
printk
(
"pas2_pcm.c: static int pas_audio_open(int mode = %X)
\n
"
,
mode
));
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
lock
,
flags
);
if
(
pcm_busy
)
{
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
return
-
EBUSY
;
}
pcm_busy
=
1
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
if
((
err
=
pas_set_intr
(
PAS_PCM_INTRBITS
))
<
0
)
return
err
;
...
...
@@ -238,15 +239,14 @@ static void pas_audio_close(int dev)
DEB
(
printk
(
"pas2_pcm.c: static void pas_audio_close(void)
\n
"
));
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
lock
,
flags
);
pas_audio_reset
(
dev
);
pas_remove_intr
(
PAS_PCM_INTRBITS
);
pcm_mode
=
PCM_NON
;
pcm_busy
=
0
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
}
static
void
pas_audio_output_block
(
int
dev
,
unsigned
long
buf
,
int
count
,
...
...
@@ -265,8 +265,7 @@ static void pas_audio_output_block(int dev, unsigned long buf, int count,
cnt
==
pcm_count
)
return
;
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
lock
,
flags
);
pas_write
(
pas_read
(
0xF8A
)
&
~
0x40
,
0xF8A
);
...
...
@@ -293,7 +292,7 @@ static void pas_audio_output_block(int dev, unsigned long buf, int count,
pcm_mode
=
PCM_DAC
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
}
static
void
pas_audio_start_input
(
int
dev
,
unsigned
long
buf
,
int
count
,
...
...
@@ -313,8 +312,7 @@ static void pas_audio_start_input(int dev, unsigned long buf, int count,
cnt
==
pcm_count
)
return
;
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
lock
,
flags
);
/* DMAbuf_start_dma (dev, buf, count, DMA_MODE_READ); */
...
...
@@ -338,7 +336,7 @@ static void pas_audio_start_input(int dev, unsigned long buf, int count,
pcm_mode
=
PCM_ADC
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
}
#ifndef NO_TRIGGER
...
...
@@ -346,8 +344,7 @@ static void pas_audio_trigger(int dev, int state)
{
unsigned
long
flags
;
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
lock
,
flags
);
state
&=
open_mode
;
if
(
state
&
PCM_ENABLE_OUTPUT
)
...
...
@@ -357,7 +354,7 @@ static void pas_audio_trigger(int dev, int state)
else
pas_write
(
pas_read
(
0xF8A
)
&
~
0x40
,
0xF8A
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
}
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment