mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-26 22:38:34 +00:00
more porting
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1183 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
2a06f76f81
commit
06aff848e3
3 changed files with 18 additions and 3 deletions
|
@ -345,6 +345,20 @@ void Event::Wait()
|
|||
pthread_mutex_unlock(&mutex_);
|
||||
}
|
||||
|
||||
int InterlockedIncrement(int *Addend)
|
||||
{
|
||||
#if defined(__GNUC__) && defined (__GNUC_MINOR__) && ((4 < __GNUC__) || (4 == __GNUC__ && 1 <= __GNUC_MINOR__))
|
||||
return __sync_add_and_fetch(Addend, 1);
|
||||
#else
|
||||
register int result;
|
||||
__asm__ __volatile__("lock; xadd %0,%1"
|
||||
: "=r" (result), "=m" (1)
|
||||
: "0" (Increment), "m" (1)
|
||||
: "memory");
|
||||
return result + 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int InterlockedExchangeAdd(int *Addend, int Increment)
|
||||
{
|
||||
#if defined(__GNUC__) && defined (__GNUC_MINOR__) && ((4 < __GNUC__) || (4 == __GNUC__ && 1 <= __GNUC_MINOR__))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue