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
455c194d
Commit
455c194d
authored
Jul 02, 2003
by
Marcus Meissner
Committed by
Alexandre Julliard
Jul 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PowerPC inline versions of the interlocked functions.
parent
5061d3a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
winbase.h
include/winbase.h
+70
-0
No files found.
include/winbase.h
View file @
455c194d
...
...
@@ -1935,6 +1935,76 @@ extern inline HANDLE WINAPI GetProcessHeap(void)
return
pdb
[
0x18
/
sizeof
(
HANDLE
)];
/* get dword at offset 0x18 in pdb */
}
#elif defined(__GNUC__) && defined(__powerpc__)
extern
inline
LONG
WINAPI
InterlockedCompareExchange
(
PLONG
dest
,
LONG
xchg
,
LONG
compare
);
extern
inline
LONG
WINAPI
InterlockedCompareExchange
(
PLONG
dest
,
LONG
xchg
,
LONG
compare
)
{
LONG
ret
=
0
;
LONG
scratch
;
__asm__
(
"0: lwarx %0,0,%2
\n
"
" xor. %1,%4,%0
\n
"
" bne 1f
\n
"
" stwcx. %3,0,%2
\n
"
" bne- 0b
\n
"
" isync
\n
"
"1: "
:
"=&r"
(
ret
),
"=&r"
(
scratch
)
:
"r"
(
dest
),
"r"
(
xchg
),
"r"
(
compare
)
:
"cr0"
,
"memory"
,
"r0"
);
return
ret
;
}
extern
inline
LONG
WINAPI
InterlockedExchange
(
PLONG
dest
,
LONG
val
);
extern
inline
LONG
WINAPI
InterlockedExchange
(
PLONG
dest
,
LONG
val
)
{
LONG
ret
=
0
;
__asm__
(
"0: lwarx %0,0,%1
\n
"
" stwcx. %2,0,%1
\n
"
" bne- 0b
\n
"
" isync
\n
"
:
"=&r"
(
ret
)
:
"r"
(
dest
),
"r"
(
val
)
:
"cr0"
,
"memory"
,
"r0"
);
return
ret
;
}
extern
inline
LONG
WINAPI
InterlockedExchangeAdd
(
PLONG
dest
,
LONG
incr
);
extern
inline
LONG
WINAPI
InterlockedExchangeAdd
(
PLONG
dest
,
LONG
incr
)
{
LONG
ret
=
0
;
LONG
zero
=
0
;
__asm__
(
"0: lwarx %0, %3, %1
\n
"
" add %0, %2, %0
\n
"
" stwcx. %0, %3, %1
\n
"
" bne- 0b
\n
"
" isync
\n
"
:
"=&r"
(
ret
)
:
"r"
(
dest
),
"r"
(
incr
),
"r"
(
zero
)
:
"cr0"
,
"memory"
,
"r0"
);
return
ret
-
incr
;
}
extern
inline
LONG
WINAPI
InterlockedIncrement
(
PLONG
dest
);
extern
inline
LONG
WINAPI
InterlockedIncrement
(
PLONG
dest
)
{
return
InterlockedExchangeAdd
(
dest
,
1
)
+
1
;
}
extern
inline
LONG
WINAPI
InterlockedDecrement
(
PLONG
dest
);
extern
inline
LONG
WINAPI
InterlockedDecrement
(
PLONG
dest
)
{
return
InterlockedExchangeAdd
(
dest
,
-
1
)
-
1
;
}
DWORD
WINAPI
GetLastError
(
void
);
DWORD
WINAPI
GetCurrentProcessId
(
void
);
DWORD
WINAPI
GetCurrentThreadId
(
void
);
void
WINAPI
SetLastError
(
DWORD
err
);
HANDLE
WINAPI
GetProcessHeap
(
void
);
#else
/* __i386__ && __GNUC__ */
DWORD
WINAPI
GetCurrentProcessId
(
void
);
DWORD
WINAPI
GetCurrentThreadId
(
void
);
...
...
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