Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
3a17a87c
Commit
3a17a87c
authored
22 years ago
by
Marcus Meissner
Committed by
Alexandre Julliard
22 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Cleaned up interlocking funcs for PPC, fixed return value of
interlocked_add.
parent
7678791d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
library/port.c
+14
-25
14 additions, 25 deletions
library/port.c
with
14 additions
and
25 deletions
library/port.c
+
14
−
25
View file @
3a17a87c
...
...
@@ -752,89 +752,78 @@ __declspec(naked) long interlocked_xchg_add( long *dest, long incr )
#elif defined(__powerpc__)
void
*
interlocked_cmpxchg_ptr
(
void
**
dest
,
void
*
xchg
,
void
*
compare
)
{
long
ret
;
long
ret
=
0
;
long
scratch
;
__asm__
__volatile__
(
"sync; "
"0: lwarx %0,0,%2 ;"
" xor. %1,%4,%0;"
" bne 1f;"
" stwcx. %3,0,%2;"
" bne- 0b;"
"1: "
"sync; "
:
"=&r"
(
ret
),
"=&r"
(
scratch
)
:
"r"
(
dest
),
"r"
(
xchg
),
"r"
(
compare
)
:
"cr0"
,
"memory"
);
:
"cr0"
,
"memory"
);
return
(
void
*
)
ret
;
}
long
interlocked_cmpxchg
(
long
*
dest
,
long
xchg
,
long
compare
)
{
long
ret
;
long
ret
=
0
;
long
scratch
;
__asm__
__volatile__
(
"sync; "
"0: lwarx %0,0,%2 ;"
" xor. %1,%4,%0;"
" bne 1f;"
" stwcx. %3,0,%2;"
" bne- 0b;"
"1: "
"sync; "
:
"=&r"
(
ret
),
"=&r"
(
scratch
)
:
"r"
(
dest
),
"r"
(
xchg
),
"r"
(
compare
)
:
"cr0"
,
"memory"
);
:
"cr0"
,
"memory"
);
return
ret
;
}
long
interlocked_xchg_add
(
long
*
dest
,
long
incr
)
{
void
*
ret
__attribute__
((
aligned
(
4
)))
=
&
ret
;
long
inc
=
incr
;
long
ret
=
0
;
long
zero
=
0
;
__asm__
__volatile__
(
"sync; "
"0: lwarx %0, %3, %1;"
" add %0, %2, %0;"
" stwcx. %0, %3, %1;"
" bne- 0b;"
"sync; "
:
"=&r"
(
ret
)
:
"r"
(
dest
),
"r"
(
inc
),
"r"
(
zero
)
:
"=&r"
(
ret
)
:
"r"
(
dest
),
"r"
(
incr
),
"r"
(
zero
)
:
"cr0"
,
"memory"
);
return
(
long
)
ret
;
return
ret
-
incr
;
}
long
interlocked_xchg
(
long
*
dest
,
long
val
)
{
void
*
ret
__attribute__
((
aligned
(
4
)))
=
&
ret
;
long
ret
=
0
;
__asm__
__volatile__
(
"sync; "
"0: lwarx %0,0,%1 ;"
" stwcx. %2,0,%1;"
" bne- 0b;"
"sync; "
:
"=&r"
(
ret
)
:
"r"
(
dest
),
"r"
(
val
)
:
"cr0"
,
"memory"
);
return
(
long
)
ret
;
:
"cr0"
,
"memory"
);
return
ret
;
}
void
*
interlocked_xchg_ptr
(
void
**
dest
,
void
*
val
)
{
void
*
ret
__attribute__
((
aligned
(
4
)))
=
&
ret
;
void
*
ret
=
NULL
;
__asm__
__volatile__
(
"sync; "
"0: lwarx %0,0,%1 ;"
" stwcx. %2,0,%1;"
" bne- 0b;"
"sync; "
:
"=&r"
(
ret
)
:
"r"
(
dest
),
"r"
(
val
)
:
"cr0"
,
"memory"
);
return
(
void
*
)
ret
;
:
"cr0"
,
"memory"
);
return
ret
;
}
#elif defined(__sparc__) && defined(__sun__)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment