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
0a4d98b4
Commit
0a4d98b4
authored
Aug 30, 2002
by
Peter Wächtler
Committed by
Linus Torvalds
Aug 30, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] oss/sys_timer.c - convert cli to spinlocks
parent
e1f63f69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
sound/oss/sys_timer.c
sound/oss/sys_timer.c
+6
-4
No files found.
sound/oss/sys_timer.c
View file @
0a4d98b4
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
* Thomas Sailer : ioctl code reworked (vmalloc/vfree removed)
* Thomas Sailer : ioctl code reworked (vmalloc/vfree removed)
* Andrew Veliath : adapted tmr2ticks from level 1 sequencer (avoid overflow)
* Andrew Veliath : adapted tmr2ticks from level 1 sequencer (avoid overflow)
*/
*/
#include <linux/spinlock.h>
#include "sound_config.h"
#include "sound_config.h"
static
volatile
int
opened
=
0
,
tmr_running
=
0
;
static
volatile
int
opened
=
0
,
tmr_running
=
0
;
...
@@ -26,7 +27,7 @@ static volatile unsigned long next_event_time;
...
@@ -26,7 +27,7 @@ static volatile unsigned long next_event_time;
static
unsigned
long
prev_event_time
;
static
unsigned
long
prev_event_time
;
static
void
poll_def_tmr
(
unsigned
long
dummy
);
static
void
poll_def_tmr
(
unsigned
long
dummy
);
static
spinlock_t
lock
=
SPIN_LOCK_UNLOCKED
;
static
struct
timer_list
def_tmr
=
static
struct
timer_list
def_tmr
=
{
function
:
poll_def_tmr
};
{
function
:
poll_def_tmr
};
...
@@ -62,6 +63,7 @@ poll_def_tmr(unsigned long dummy)
...
@@ -62,6 +63,7 @@ poll_def_tmr(unsigned long dummy)
if
(
tmr_running
)
if
(
tmr_running
)
{
{
spin_lock
(
&
lock
);
tmr_ctr
++
;
tmr_ctr
++
;
curr_ticks
=
ticks_offs
+
tmr2ticks
(
tmr_ctr
);
curr_ticks
=
ticks_offs
+
tmr2ticks
(
tmr_ctr
);
...
@@ -70,6 +72,7 @@ poll_def_tmr(unsigned long dummy)
...
@@ -70,6 +72,7 @@ poll_def_tmr(unsigned long dummy)
next_event_time
=
(
unsigned
long
)
-
1
;
next_event_time
=
(
unsigned
long
)
-
1
;
sequencer_timer
(
0
);
sequencer_timer
(
0
);
}
}
spin_unlock
(
&
lock
);
}
}
}
}
}
}
...
@@ -79,15 +82,14 @@ tmr_reset(void)
...
@@ -79,15 +82,14 @@ tmr_reset(void)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
lock
,
flags
);
cli
();
tmr_offs
=
0
;
tmr_offs
=
0
;
ticks_offs
=
0
;
ticks_offs
=
0
;
tmr_ctr
=
0
;
tmr_ctr
=
0
;
next_event_time
=
(
unsigned
long
)
-
1
;
next_event_time
=
(
unsigned
long
)
-
1
;
prev_event_time
=
0
;
prev_event_time
=
0
;
curr_ticks
=
0
;
curr_ticks
=
0
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
}
}
static
int
static
int
...
...
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