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
fb454fda
Commit
fb454fda
authored
Aug 12, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up asm-i386/smplock.h
parent
7cc2fd8b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
40 deletions
+11
-40
include/asm-i386/smplock.h
include/asm-i386/smplock.h
+11
-40
No files found.
include/asm-i386/smplock.h
View file @
fb454fda
...
...
@@ -10,15 +10,10 @@
extern
spinlock_t
kernel_flag
;
#ifdef CONFIG_SMP
#define kernel_locked() spin_is_locked(&kernel_flag)
#else
#ifdef CONFIG_PREEMPT
#define kernel_locked() preempt_count()
#else
#define kernel_locked() 1
#endif
#endif
#define kernel_locked() (current->lock_depth >= 0)
#define get_kernel_lock() spin_lock(&kernel_flag)
#define put_kernel_lock() spin_unlock(&kernel_flag)
/*
* Release global kernel lock and global interrupt lock
...
...
@@ -26,7 +21,7 @@ extern spinlock_t kernel_flag;
#define release_kernel_lock(task) \
do { \
if (unlikely(task->lock_depth >= 0)) \
spin_unlock(&kernel_flag);
\
put_kernel_lock();
\
} while (0)
/*
...
...
@@ -35,7 +30,7 @@ do { \
#define reacquire_kernel_lock(task) \
do { \
if (unlikely(task->lock_depth >= 0)) \
spin_lock(&kernel_flag);
\
get_kernel_lock();
\
} while (0)
...
...
@@ -48,40 +43,16 @@ do { \
*/
static
__inline__
void
lock_kernel
(
void
)
{
#ifdef CONFIG_PREEMPT
if
(
current
->
lock_depth
==
-
1
)
spin_lock
(
&
kernel_flag
);
++
current
->
lock_depth
;
#else
#if 1
if
(
!++
current
->
lock_depth
)
spin_lock
(
&
kernel_flag
);
#else
__asm__
__volatile__
(
"incl %1
\n\t
"
"jne 9f"
spin_lock_string
"
\n
9:"
:
"=m"
(
__dummy_lock
(
&
kernel_flag
)),
"=m"
(
current
->
lock_depth
));
#endif
#endif
int
depth
=
current
->
lock_depth
+
1
;
if
(
!
depth
)
get_kernel_lock
();
current
->
lock_depth
=
depth
;
}
static
__inline__
void
unlock_kernel
(
void
)
{
if
(
current
->
lock_depth
<
0
)
BUG
();
#if 1
if
(
--
current
->
lock_depth
<
0
)
spin_unlock
(
&
kernel_flag
);
#else
__asm__
__volatile__
(
"decl %1
\n\t
"
"jns 9f
\n\t
"
spin_unlock_string
"
\n
9:"
:
"=m"
(
__dummy_lock
(
&
kernel_flag
)),
"=m"
(
current
->
lock_depth
));
#endif
put_kernel_lock
();
}
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