libport: Implemented the interlocked_cmpxchg128 function for ARM64.

oldstable
André Hentschel 2013-01-16 00:42:12 +01:00 committed by Alexandre Julliard
parent 16954b3a82
commit c2ef2edf85
1 changed files with 22 additions and 0 deletions

View File

@ -313,6 +313,28 @@ __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int64 compare )
return compare;
}
#ifdef __aarch64__
int interlocked_cmpxchg128( __int64 *dest, __int64 xchg_high, __int64 xchg_low, __int64 *compare )
{
int retv;
pthread_mutex_lock( &interlocked_mutex );
if (dest[0] == compare[0] && dest[1] == compare[1])
{
dest[0] = xchg_low;
dest[1] = xchg_high;
retv = 1;
}
else
{
compare[0] = dest[0];
compare[1] = dest[1];
retv = 0;
}
pthread_mutex_unlock( &interlocked_mutex );
return retv;
}
#endif
int interlocked_xchg( int *dest, int val )
{
int retv;