}
#define AO_HAVE_test_and_set
-/* NEC LE-IT: fetch and add for ARMv6 */
AO_INLINE AO_t
AO_fetch_and_add(volatile AO_t *p, AO_t incr)
{
}
#define AO_HAVE_fetch_and_add
-/* NEC LE-IT: fetch and add1 for ARMv6 */
AO_INLINE AO_t
AO_fetch_and_add1(volatile AO_t *p)
{
}
#define AO_HAVE_fetch_and_add1
-/* NEC LE-IT: fetch and sub for ARMv6 */
AO_INLINE AO_t
AO_fetch_and_sub1(volatile AO_t *p)
{
#define AO_HAVE_fetch_and_sub1
#endif /* !AO_PREFER_GENERALIZED */
-/* NEC LE-IT: compare and swap */
#ifndef AO_GENERALIZE_ASM_BOOL_CAS
/* Returns nonzero if the comparison succeeded. */
AO_INLINE int
/* helper functions for the Realview compiler: LDREXD is not usable
* with inline assembler, so use the "embedded" assembler as
* suggested by ARM Dev. support (June 2008). */
-__asm inline double_ptr_storage load_ex(volatile AO_double_t *addr) {
+__asm inline double_ptr_storage AO_load_ex(volatile AO_double_t *addr) {
LDREXD r0,r1,[r0]
}
-__asm inline int store_ex(AO_t val1, AO_t val2, volatile AO_double_t *addr) {
+__asm inline int AO_store_ex(AO_t val1, AO_t val2, volatile AO_double_t *addr) {
STREXD r3,r0,r1,[r2]
MOV r0,r3
}
int result;
while(1) {
- tmp = load_ex(addr);
+ tmp = AO_load_ex(addr);
if(tmp != old_val) return 0;
- result = store_ex(new_val1, new_val2, addr);
+ result = AO_store_ex(new_val1, new_val2, addr);
if(!result) return 1;
}
}