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
aabdaed1
Commit
aabdaed1
authored
Jan 18, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Use __atomic_exchange_n() for InterlockedExchange*() if possible.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dc02bbee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
winnt.h
include/winnt.h
+6
-2
No files found.
include/winnt.h
View file @
aabdaed1
...
@@ -7015,7 +7015,9 @@ static FORCEINLINE unsigned char InterlockedCompareExchange128( volatile __int64
...
@@ -7015,7 +7015,9 @@ static FORCEINLINE unsigned char InterlockedCompareExchange128( volatile __int64
static
FORCEINLINE
LONG
WINAPI
InterlockedExchange
(
LONG
volatile
*
dest
,
LONG
val
)
static
FORCEINLINE
LONG
WINAPI
InterlockedExchange
(
LONG
volatile
*
dest
,
LONG
val
)
{
{
LONG
ret
;
LONG
ret
;
#if defined(__i386__) || defined(__x86_64__)
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))
ret
=
__atomic_exchange_n
(
dest
,
val
,
__ATOMIC_SEQ_CST
);
#elif defined(__i386__) || defined(__x86_64__)
__asm__
__volatile__
(
"lock; xchgl %0,(%1)"
__asm__
__volatile__
(
"lock; xchgl %0,(%1)"
:
"=r"
(
ret
)
:
"r"
(
dest
),
"0"
(
val
)
:
"memory"
);
:
"=r"
(
ret
)
:
"r"
(
dest
),
"0"
(
val
)
:
"memory"
);
#else
#else
...
@@ -7042,7 +7044,9 @@ static FORCEINLINE LONG WINAPI InterlockedDecrement( LONG volatile *dest )
...
@@ -7042,7 +7044,9 @@ static FORCEINLINE LONG WINAPI InterlockedDecrement( LONG volatile *dest )
static
FORCEINLINE
void
*
WINAPI
InterlockedExchangePointer
(
void
*
volatile
*
dest
,
void
*
val
)
static
FORCEINLINE
void
*
WINAPI
InterlockedExchangePointer
(
void
*
volatile
*
dest
,
void
*
val
)
{
{
void
*
ret
;
void
*
ret
;
#ifdef __x86_64__
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))
ret
=
__atomic_exchange_n
(
dest
,
val
,
__ATOMIC_SEQ_CST
);
#elif defined(__x86_64__)
__asm__
__volatile__
(
"lock; xchgq %0,(%1)"
:
"=r"
(
ret
)
:
"r"
(
dest
),
"0"
(
val
)
:
"memory"
);
__asm__
__volatile__
(
"lock; xchgq %0,(%1)"
:
"=r"
(
ret
)
:
"r"
(
dest
),
"0"
(
val
)
:
"memory"
);
#elif defined(__i386__)
#elif defined(__i386__)
__asm__
__volatile__
(
"lock; xchgl %0,(%1)"
:
"=r"
(
ret
)
:
"r"
(
dest
),
"0"
(
val
)
:
"memory"
);
__asm__
__volatile__
(
"lock; xchgl %0,(%1)"
:
"=r"
(
ret
)
:
"r"
(
dest
),
"0"
(
val
)
:
"memory"
);
...
...
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