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
Kirill Smelkov
linux
Commits
72069dc5
Commit
72069dc5
authored
Apr 07, 2003
by
Alan Cox
Committed by
Linus Torvalds
Apr 07, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix modular gus shared lock
parent
8bc47ee1
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
145 additions
and
145 deletions
+145
-145
sound/oss/gus_midi.c
sound/oss/gus_midi.c
+22
-22
sound/oss/gus_wave.c
sound/oss/gus_wave.c
+123
-123
No files found.
sound/oss/gus_midi.c
View file @
72069dc5
...
@@ -26,7 +26,6 @@ static int midi_busy = 0, input_opened = 0;
...
@@ -26,7 +26,6 @@ static int midi_busy = 0, input_opened = 0;
static
int
my_dev
;
static
int
my_dev
;
static
int
output_used
=
0
;
static
int
output_used
=
0
;
static
volatile
unsigned
char
gus_midi_control
;
static
volatile
unsigned
char
gus_midi_control
;
static
spinlock_t
lock
=
SPIN_LOCK_UNLOCKED
;
static
void
(
*
midi_input_intr
)
(
int
dev
,
unsigned
char
data
);
static
void
(
*
midi_input_intr
)
(
int
dev
,
unsigned
char
data
);
static
unsigned
char
tmp_queue
[
256
];
static
unsigned
char
tmp_queue
[
256
];
...
@@ -35,6 +34,7 @@ static volatile int qlen;
...
@@ -35,6 +34,7 @@ static volatile int qlen;
static
volatile
unsigned
char
qhead
,
qtail
;
static
volatile
unsigned
char
qhead
,
qtail
;
extern
int
gus_base
,
gus_irq
,
gus_dma
;
extern
int
gus_base
,
gus_irq
,
gus_dma
;
extern
int
*
gus_osp
;
extern
int
*
gus_osp
;
extern
spinlock_t
gus_lock
;
static
int
GUS_MIDI_STATUS
(
void
)
static
int
GUS_MIDI_STATUS
(
void
)
{
{
...
@@ -76,7 +76,7 @@ static int dump_to_midi(unsigned char midi_byte)
...
@@ -76,7 +76,7 @@ static int dump_to_midi(unsigned char midi_byte)
output_used
=
1
;
output_used
=
1
;
spin_lock_irqsave
(
&
lock
,
flags
);
spin_lock_irqsave
(
&
gus_
lock
,
flags
);
if
(
GUS_MIDI_STATUS
()
&
MIDI_XMIT_EMPTY
)
if
(
GUS_MIDI_STATUS
()
&
MIDI_XMIT_EMPTY
)
{
{
...
@@ -92,7 +92,7 @@ static int dump_to_midi(unsigned char midi_byte)
...
@@ -92,7 +92,7 @@ static int dump_to_midi(unsigned char midi_byte)
outb
((
gus_midi_control
),
u_MidiControl
);
outb
((
gus_midi_control
),
u_MidiControl
);
}
}
spin_unlock_irqrestore
(
&
lock
,
flags
);
spin_unlock_irqrestore
(
&
gus_
lock
,
flags
);
return
ok
;
return
ok
;
}
}
...
@@ -113,14 +113,14 @@ static int gus_midi_out(int dev, unsigned char midi_byte)
...
@@ -113,14 +113,14 @@ static int gus_midi_out(int dev, unsigned char midi_byte)
/*
/*
* Drain the local queue first
* Drain the local queue first
*/
*/
spin_lock_irqsave
(
&
lock
,
flags
);
spin_lock_irqsave
(
&
gus_
lock
,
flags
);
while
(
qlen
&&
dump_to_midi
(
tmp_queue
[
qhead
]))
while
(
qlen
&&
dump_to_midi
(
tmp_queue
[
qhead
]))
{
{
qlen
--
;
qlen
--
;
qhead
++
;
qhead
++
;
}
}
spin_unlock_irqrestore
(
&
lock
,
flags
);
spin_unlock_irqrestore
(
&
gus_
lock
,
flags
);
/*
/*
* Output the byte if the local queue is empty.
* Output the byte if the local queue is empty.
...
@@ -140,13 +140,13 @@ static int gus_midi_out(int dev, unsigned char midi_byte)
...
@@ -140,13 +140,13 @@ static int gus_midi_out(int dev, unsigned char midi_byte)
return
0
;
/*
return
0
;
/*
* Local queue full
* Local queue full
*/
*/
spin_lock_irqsave
(
&
lock
,
flags
);
spin_lock_irqsave
(
&
gus_
lock
,
flags
);
tmp_queue
[
qtail
]
=
midi_byte
;
tmp_queue
[
qtail
]
=
midi_byte
;
qlen
++
;
qlen
++
;
qtail
++
;
qtail
++
;
spin_unlock_irqrestore
(
&
lock
,
flags
);
spin_unlock_irqrestore
(
&
gus_
lock
,
flags
);
return
1
;
return
1
;
}
}
...
@@ -171,14 +171,14 @@ static int gus_midi_buffer_status(int dev)
...
@@ -171,14 +171,14 @@ static int gus_midi_buffer_status(int dev)
if
(
!
output_used
)
if
(
!
output_used
)
return
0
;
return
0
;
spin_lock_irqsave
(
&
lock
,
flags
);
spin_lock_irqsave
(
&
gus_
lock
,
flags
);
if
(
qlen
&&
dump_to_midi
(
tmp_queue
[
qhead
]))
if
(
qlen
&&
dump_to_midi
(
tmp_queue
[
qhead
]))
{
{
qlen
--
;
qlen
--
;
qhead
++
;
qhead
++
;
}
}
spin_unlock_irqrestore
(
&
lock
,
flags
);
spin_unlock_irqrestore
(
&
gus_
lock
,
flags
);
return
(
qlen
>
0
)
||
!
(
GUS_MIDI_STATUS
()
&
MIDI_XMIT_EMPTY
);
return
(
qlen
>
0
)
||
!
(
GUS_MIDI_STATUS
()
&
MIDI_XMIT_EMPTY
);
}
}
...
@@ -188,17 +188,17 @@ static int gus_midi_buffer_status(int dev)
...
@@ -188,17 +188,17 @@ static int gus_midi_buffer_status(int dev)
static
struct
midi_operations
gus_midi_operations
=
static
struct
midi_operations
gus_midi_operations
=
{
{
owner:
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
info:
{
"Gravis UltraSound Midi"
,
0
,
0
,
SNDCARD_GUS
},
.
info
=
{
"Gravis UltraSound Midi"
,
0
,
0
,
SNDCARD_GUS
},
converter:
&
std_midi_synth
,
.
converter
=
&
std_midi_synth
,
in_info:
{
0
},
.
in_info
=
{
0
},
open:
gus_midi_open
,
.
open
=
gus_midi_open
,
close:
gus_midi_close
,
.
close
=
gus_midi_close
,
outputc:
gus_midi_out
,
.
outputc
=
gus_midi_out
,
start_read:
gus_midi_start_read
,
.
start_read
=
gus_midi_start_read
,
end_read:
gus_midi_end_read
,
.
end_read
=
gus_midi_end_read
,
kick:
gus_midi_kick
,
.
kick
=
gus_midi_kick
,
buffer_status:
gus_midi_buffer_status
,
.
buffer_status
=
gus_midi_buffer_status
,
};
};
void
__init
gus_midi_init
(
struct
address_info
*
hw_config
)
void
__init
gus_midi_init
(
struct
address_info
*
hw_config
)
...
@@ -224,7 +224,7 @@ void gus_midi_interrupt(int dummy)
...
@@ -224,7 +224,7 @@ void gus_midi_interrupt(int dummy)
volatile
unsigned
char
stat
,
data
;
volatile
unsigned
char
stat
,
data
;
int
timeout
=
10
;
int
timeout
=
10
;
spin_lock
(
&
lock
);
spin_lock
(
&
gus_
lock
);
while
(
timeout
--
>
0
&&
(
stat
=
GUS_MIDI_STATUS
())
&
(
MIDI_RCV_FULL
|
MIDI_XMIT_EMPTY
))
while
(
timeout
--
>
0
&&
(
stat
=
GUS_MIDI_STATUS
())
&
(
MIDI_RCV_FULL
|
MIDI_XMIT_EMPTY
))
{
{
...
@@ -252,5 +252,5 @@ void gus_midi_interrupt(int dummy)
...
@@ -252,5 +252,5 @@ void gus_midi_interrupt(int dummy)
}
}
}
}
}
}
spin_unlock
(
&
lock
);
spin_unlock
(
&
gus_
lock
);
}
}
sound/oss/gus_wave.c
View file @
72069dc5
This diff is collapsed.
Click to expand it.
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