aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/nptl
diff options
context:
space:
mode:
authorTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>2015-12-28 12:24:43 -0200
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>2016-01-08 17:47:33 -0200
commit42bf1c897170ff951c7fd0ee9da25f97ff787396 (patch)
tree3e69cd2d5201944482407b86b4854fe75ab34f12 /sysdeps/powerpc/nptl
parentbc49a7afd38c1bd00f0ad9fd6592a5959d5ba72e (diff)
downloadglibc-42bf1c897170ff951c7fd0ee9da25f97ff787396.zip
glibc-42bf1c897170ff951c7fd0ee9da25f97ff787396.tar.gz
glibc-42bf1c897170ff951c7fd0ee9da25f97ff787396.tar.bz2
powerpc: Enforce compiler barriers on hardware transactions
Work around a GCC behavior with hardware transactional memory built-ins. GCC doesn't treat the PowerPC transactional built-ins as compiler barriers, moving instructions past the transaction boundaries and altering their atomicity.
Diffstat (limited to 'sysdeps/powerpc/nptl')
-rw-r--r--sysdeps/powerpc/nptl/elide.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/powerpc/nptl/elide.h b/sysdeps/powerpc/nptl/elide.h
index c737464..77bd82e 100644
--- a/sysdeps/powerpc/nptl/elide.h
+++ b/sysdeps/powerpc/nptl/elide.h
@@ -68,14 +68,14 @@ __get_new_count (uint8_t *adapt_count, int attempt)
else \
for (int i = __elision_aconf.try_tbegin; i > 0; i--) \
{ \
- if (__builtin_tbegin (0)) \
+ if (__libc_tbegin (0)) \
{ \
if (is_lock_free) \
{ \
ret = 1; \
break; \
} \
- __builtin_tabort (_ABORT_LOCK_BUSY); \
+ __libc_tabort (_ABORT_LOCK_BUSY); \
} \
else \
if (!__get_new_count (&adapt_count,i)) \
@@ -90,7 +90,7 @@ __get_new_count (uint8_t *adapt_count, int attempt)
if (__elision_aconf.try_tbegin > 0) \
{ \
if (write) \
- __builtin_tabort (_ABORT_NESTED_TRYLOCK); \
+ __libc_tabort (_ABORT_NESTED_TRYLOCK); \
ret = ELIDE_LOCK (adapt_count, is_lock_free); \
} \
ret; \
@@ -102,7 +102,7 @@ __elide_unlock (int is_lock_free)
{
if (is_lock_free)
{
- __builtin_tend (0);
+ __libc_tend (0);
return true;
}
return false;