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
620f7a5a
Commit
620f7a5a
authored
Sep 14, 2004
by
Richard Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ALPHA] Implement _raw_write_trylock.
parent
90825280
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
include/asm-alpha/spinlock.h
include/asm-alpha/spinlock.h
+23
-0
No files found.
include/asm-alpha/spinlock.h
View file @
620f7a5a
...
@@ -148,6 +148,29 @@ static inline void _raw_read_lock(rwlock_t * lock)
...
@@ -148,6 +148,29 @@ static inline void _raw_read_lock(rwlock_t * lock)
}
}
#endif
/* CONFIG_DEBUG_RWLOCK */
#endif
/* CONFIG_DEBUG_RWLOCK */
static
inline
int
_raw_write_trylock
(
rwlock_t
*
lock
)
{
long
regx
;
int
success
;
__asm__
__volatile__
(
"1: ldl_l %1,%0
\n
"
" lda %2,0
\n
"
" bne %1,2f
\n
"
" or $31,1,%1
\n
"
" stl_c %1,%0
\n
"
" beq %1,6f
\n
"
" lda %2,1
\n
"
"2: mb
\n
"
".subsection 2
\n
"
"6: br 1b
\n
"
".previous"
:
"=m"
(
*
lock
),
"=&r"
(
regx
),
"=&r"
(
success
)
:
"m"
(
*
lock
)
:
"memory"
);
return
success
;
}
static
inline
void
_raw_write_unlock
(
rwlock_t
*
lock
)
static
inline
void
_raw_write_unlock
(
rwlock_t
*
lock
)
{
{
mb
();
mb
();
...
...
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