Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c5bb7303
Commit
c5bb7303
authored
May 04, 2003
by
Pierre d'Herbemont
Committed by
Alexandre Julliard
May 04, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add register preservation when using lawrx instruction.
Fix ';' ending to '\n' ending for a better compatibility with darwin.
parent
9d1ca9fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
interlocked.c
libs/port/interlocked.c
+24
-24
No files found.
libs/port/interlocked.c
View file @
c5bb7303
...
...
@@ -107,11 +107,11 @@ void* interlocked_cmpxchg_ptr( void **dest, void* xchg, void* compare)
long
ret
=
0
;
long
scratch
;
__asm__
__volatile__
(
"0: lwarx %0,0,%2
;
"
" xor. %1,%4,%0
;
"
" bne 1f
;
"
" stwcx. %3,0,%2
;
"
" bne- 0b
;
"
"0: lwarx %0,0,%2
\n
"
" xor. %1,%4,%0
\n
"
" bne 1f
\n
"
" stwcx. %3,0,%2
\n
"
" bne- 0b
\n
"
"1: "
:
"=&r"
(
ret
),
"=&r"
(
scratch
)
:
"r"
(
dest
),
"r"
(
xchg
),
"r"
(
compare
)
...
...
@@ -124,15 +124,15 @@ long interlocked_cmpxchg( long *dest, long xchg, long compare)
long
ret
=
0
;
long
scratch
;
__asm__
__volatile__
(
"0: lwarx %0,0,%2
;
"
" xor. %1,%4,%0
;
"
" bne 1f
;
"
" stwcx. %3,0,%2
;
"
" bne- 0b
;
"
"0: lwarx %0,0,%2
\n
"
" xor. %1,%4,%0
\n
"
" bne 1f
\n
"
" stwcx. %3,0,%2
\n
"
" bne- 0b
\n
"
"1: "
:
"=&r"
(
ret
),
"=&r"
(
scratch
)
:
"r"
(
dest
),
"r"
(
xchg
),
"r"
(
compare
)
:
"cr0"
,
"memory"
);
:
"cr0"
,
"memory"
,
"r0"
);
return
ret
;
}
...
...
@@ -141,13 +141,13 @@ long interlocked_xchg_add( long *dest, long incr )
long
ret
=
0
;
long
zero
=
0
;
__asm__
__volatile__
(
"0: lwarx %0, %3, %1
;
"
" add %0, %2, %0
;
"
" stwcx. %0, %3, %1
;
"
" bne- 0b
;
"
"0: lwarx %0, %3, %1
\n
"
" add %0, %2, %0
\n
"
" stwcx. %0, %3, %1
\n
"
" bne- 0b
\n
"
:
"=&r"
(
ret
)
:
"r"
(
dest
),
"r"
(
incr
),
"r"
(
zero
)
:
"cr0"
,
"memory"
:
"cr0"
,
"memory"
,
"r0"
);
return
ret
-
incr
;
}
...
...
@@ -156,12 +156,12 @@ long interlocked_xchg( long* dest, long val )
{
long
ret
=
0
;
__asm__
__volatile__
(
"0: lwarx %0,0,%1
;
"
" stwcx. %2,0,%1
;
"
" bne- 0b
;
"
"0: lwarx %0,0,%1
\n
"
" stwcx. %2,0,%1
\n
"
" bne- 0b
\n
"
:
"=&r"
(
ret
)
:
"r"
(
dest
),
"r"
(
val
)
:
"cr0"
,
"memory"
);
:
"cr0"
,
"memory"
,
"r0"
);
return
ret
;
}
...
...
@@ -169,12 +169,12 @@ void* interlocked_xchg_ptr( void** dest, void* val )
{
void
*
ret
=
NULL
;
__asm__
__volatile__
(
"0: lwarx %0,0,%1
;
"
" stwcx. %2,0,%1
;
"
" bne- 0b
;
"
"0: lwarx %0,0,%1
\n
"
" stwcx. %2,0,%1
\n
"
" bne- 0b
\n
"
:
"=&r"
(
ret
)
:
"r"
(
dest
),
"r"
(
val
)
:
"cr0"
,
"memory"
);
:
"cr0"
,
"memory"
,
"r0"
);
return
ret
;
}
...
...
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