Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c9b27e90
Commit
c9b27e90
authored
Sep 13, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented InterlockedCompareExchangePointer and
InterlockedExchangePointer for x86-64.
parent
7c1925a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
winbase.h
include/winbase.h
+14
-1
No files found.
include/winbase.h
View file @
c9b27e90
...
@@ -2268,15 +2268,28 @@ VOID WINAPI SetLastError(DWORD);
...
@@ -2268,15 +2268,28 @@ VOID WINAPI SetLastError(DWORD);
#endif
/* __i386__ && __GNUC__ && __WINESRC__ && !_NTSYSTEM_ */
#endif
/* __i386__ && __GNUC__ && __WINESRC__ && !_NTSYSTEM_ */
/* FIXME: should handle platforms where sizeof(void*) != sizeof(long) */
static
inline
PVOID
WINAPI
InterlockedCompareExchangePointer
(
PVOID
volatile
*
dest
,
PVOID
xchg
,
PVOID
compare
)
static
inline
PVOID
WINAPI
InterlockedCompareExchangePointer
(
PVOID
volatile
*
dest
,
PVOID
xchg
,
PVOID
compare
)
{
{
#if defined(__x86_64__) && defined(__GNUC__)
PVOID
ret
;
__asm__
__volatile__
(
"lock; cmpxchgq %2,(%1)"
:
"=a"
(
ret
)
:
"r"
(
dest
),
"r"
(
xchg
),
"0"
(
compare
)
:
"memory"
);
return
ret
;
#else
return
(
PVOID
)
InterlockedCompareExchange
(
(
PLONG
)
dest
,
(
LONG
)
xchg
,
(
LONG
)
compare
);
return
(
PVOID
)
InterlockedCompareExchange
(
(
PLONG
)
dest
,
(
LONG
)
xchg
,
(
LONG
)
compare
);
#endif
}
}
static
inline
PVOID
WINAPI
InterlockedExchangePointer
(
PVOID
volatile
*
dest
,
PVOID
val
)
static
inline
PVOID
WINAPI
InterlockedExchangePointer
(
PVOID
volatile
*
dest
,
PVOID
val
)
{
{
#if defined(__x86_64__) && defined(__GNUC__)
PVOID
ret
;
__asm__
__volatile__
(
"lock; xchgq %0,(%1)"
:
"=r"
(
ret
)
:
"r"
(
dest
),
"0"
(
val
)
:
"memory"
);
return
ret
;
#else
return
(
PVOID
)
InterlockedExchange
(
(
PLONG
)
dest
,
(
LONG
)
val
);
return
(
PVOID
)
InterlockedExchange
(
(
PLONG
)
dest
,
(
LONG
)
val
);
#endif
}
}
#ifdef __WINESRC__
#ifdef __WINESRC__
...
...
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