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
6ea774ea
Commit
6ea774ea
authored
Jul 27, 2002
by
Paul Mackerras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: implement __downgrade_write for rwsems.
parent
9b28245f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
include/asm-ppc/rwsem.h
include/asm-ppc/rwsem.h
+15
-1
No files found.
include/asm-ppc/rwsem.h
View file @
6ea774ea
/*
* BK Id:
SCCS/s.rwsem.h 1.6 05/17/01 18:14:25 cort
* BK Id:
%F% %I% %G% %U% %#%
*/
/*
* include/asm-ppc/rwsem.h: R/W semaphores for PPC using the stuff
...
...
@@ -55,6 +55,7 @@ struct rw_semaphore {
extern
struct
rw_semaphore
*
rwsem_down_read_failed
(
struct
rw_semaphore
*
sem
);
extern
struct
rw_semaphore
*
rwsem_down_write_failed
(
struct
rw_semaphore
*
sem
);
extern
struct
rw_semaphore
*
rwsem_wake
(
struct
rw_semaphore
*
sem
);
extern
struct
rw_semaphore
*
rwsem_downgrade_wake
(
struct
rw_semaphore
*
sem
);
static
inline
void
init_rwsem
(
struct
rw_semaphore
*
sem
)
{
...
...
@@ -124,6 +125,19 @@ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
atomic_add
(
delta
,
(
atomic_t
*
)(
&
sem
->
count
));
}
/*
* downgrade write lock to read lock
*/
static
inline
void
__downgrade_write
(
struct
rw_semaphore
*
sem
)
{
int
tmp
;
smp_wmb
();
tmp
=
atomic_add_return
(
-
RWSEM_WAITING_BIAS
,
(
atomic_t
*
)(
&
sem
->
count
));
if
(
tmp
<
0
)
rwsem_downgrade_wake
(
sem
);
}
/*
* implement exchange and add functionality
*/
...
...
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