/* 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 AO_load_ex(volatile AO_double_t *addr) {
+__asm inline double_ptr_storage AO_load_ex(const volatile AO_double_t *addr) {
LDREXD r0,r1,[r0]
}
MOV r0,r3
}
+AO_INLINE AO_double_t
+AO_double_load(const volatile AO_double_t *addr)
+{
+ AO_double_t result;
+
+ result.AO_whole = AO_load_ex(addr);
+ return result;
+}
+#define AO_HAVE_double_load
+
AO_INLINE int
AO_compare_double_and_swap_double(volatile AO_double_t *addr,
AO_t old_val1, AO_t old_val2,
# define AO_HAVE_test_and_set
#endif /* !AO_FORCE_USE_SWP */
-/* 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
#ifdef AO_ARM_HAVE_LDREXD
# include "../standard_ao_double_t.h"
+ AO_INLINE AO_double_t
+ AO_double_load(const volatile AO_double_t *addr)
+ {
+ AO_double_t result;
+
+ __asm__ __volatile__("@AO_double_load\n"
+ " ldrexd %0, [%1]"
+ : "=&r" (result.AO_whole)
+ : "r" (addr)
+ /* : no clobber */);
+ return result;
+ }
+# define AO_HAVE_double_load
+
AO_INLINE int
AO_double_compare_and_swap(volatile AO_double_t *addr,
AO_double_t old_val, AO_double_t new_val)