mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
Added atomic code for PowerPC
Original commit message from CVS: Added atomic code for PowerPC
This commit is contained in:
parent
2b647a953c
commit
edd2819c89
1 changed files with 36 additions and 0 deletions
|
@ -163,6 +163,42 @@ G_STMT_START { \
|
||||||
: "ecx", "ebx"); \
|
: "ecx", "ebx"); \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
||||||
|
#elif defined (__powerpc__) && defined (__GNUC__) && __GNUC__ >= 2
|
||||||
|
|
||||||
|
#define _GST_ATOMIC_SWAP_INIT(swap,val) \
|
||||||
|
G_STMT_START { \
|
||||||
|
(swap)->value = (gpointer)(val); \
|
||||||
|
(swap)->cnt = 0; \
|
||||||
|
} G_STMT_END
|
||||||
|
|
||||||
|
#define _GST_ATOMIC_SWAP(swap, val) \
|
||||||
|
G_STMT_START { \
|
||||||
|
__asm__ __volatile__ ("1:" \
|
||||||
|
" lwarx %0, 0, %2 \n" \
|
||||||
|
" stwcx. %3, 0, %2 \n" \
|
||||||
|
" bne- 1b \n" \
|
||||||
|
: "=&r", \
|
||||||
|
"=m" (*swap) \
|
||||||
|
: "r" (swap), \
|
||||||
|
"r" (val), \
|
||||||
|
"m" (*swap) \
|
||||||
|
: "cc", "memory"); \
|
||||||
|
} G_STMT_END
|
||||||
|
|
||||||
|
#define _GST_ATOMIC_SWAP_GET(swap, val, res) \
|
||||||
|
G_STMT_START { \
|
||||||
|
__asm__ __volatile__ ("1:" \
|
||||||
|
" lwarx %0, 0, %2 \n" \
|
||||||
|
" stwcx. %3, 0, %2 \n" \
|
||||||
|
" bne- 1b \n" \
|
||||||
|
: "=&r" (*(res)), \
|
||||||
|
"=m" (*swap) \
|
||||||
|
: "r" (swap), \
|
||||||
|
"r" (val), \
|
||||||
|
"m" (*swap) \
|
||||||
|
: "cc", "memory"); \
|
||||||
|
} G_STMT_END
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define _GST_ATOMIC_SWAP_INIT(swap,val) \
|
#define _GST_ATOMIC_SWAP_INIT(swap,val) \
|
||||||
|
|
Loading…
Reference in a new issue