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
934c02c7
Commit
934c02c7
authored
Nov 17, 2019
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libs/port: Use MSVC intrinsics for interlocked functions.
Signed-off-by:
Stefan Dösinger
<
stefan@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8101d251
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
interlocked.c
libs/port/interlocked.c
+42
-0
No files found.
libs/port/interlocked.c
View file @
934c02c7
...
...
@@ -138,6 +138,47 @@ __ASM_GLOBAL_FUNC(interlocked_xchg_add,
#elif defined(__x86_64__)
#if defined(_MSC_VER)
#include <intrin.h>
int
interlocked_cmpxchg
(
int
*
dest
,
int
xchg
,
int
compare
)
{
return
_InterlockedCompareExchange
(
dest
,
xchg
,
compare
);
}
void
*
interlocked_cmpxchg_ptr
(
void
**
dest
,
void
*
xchg
,
void
*
compare
)
{
return
_InterlockedCompareExchangePointer
(
dest
,
xchg
,
compare
);
}
__int64
interlocked_cmpxchg64
(
__int64
*
dest
,
__int64
xchg
,
__int64
compare
)
{
return
_InterlockedCompareExchange64
(
dest
,
xchg
,
compare
);
}
int
interlocked_xchg
(
int
*
dest
,
int
val
)
{
return
_InterlockedExchange
(
dest
,
val
);
}
void
*
interlocked_xchg_ptr
(
void
**
dest
,
void
*
val
)
{
return
_InterlockedExchangePointer
(
dest
,
val
);
}
int
interlocked_xchg_add
(
int
*
dest
,
int
incr
)
{
return
_InterlockedExchangeAdd
(
dest
,
incr
);
}
int
interlocked_cmpxchg128
(
__int64
*
dest
,
__int64
xchg_high
,
__int64
xchg_low
,
__int64
*
compare
)
{
return
_InterlockedCompareExchange128
(
dest
,
xchg_high
,
xchg_low
,
compare
);
}
#else
__ASM_GLOBAL_FUNC
(
interlocked_cmpxchg
,
"mov %edx, %eax
\n\t
"
"lock cmpxchgl %esi,(%rdi)
\n\t
"
...
...
@@ -179,6 +220,7 @@ __ASM_GLOBAL_FUNC(interlocked_cmpxchg128,
__ASM_CFI
(
".cfi_adjust_cfa_offset -8
\n\t
"
)
__ASM_CFI
(
".cfi_same_value %rbx
\n\t
"
)
"ret"
)
#endif
#elif defined(__powerpc__)
...
...
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