PAPI 7.1.0.0
Loading...
Searching...
No Matches
cris.h File Reference
Include dependency graph for cris.h:

Go to the source code of this file.

Macros

#define AO_HAVE_test_and_set_full
 

Functions

AO_INLINE AO_TS_VAL_t AO_test_and_set_full (volatile AO_TS_t *addr)
 

Macro Definition Documentation

◆ AO_HAVE_test_and_set_full

#define AO_HAVE_test_and_set_full

Definition at line 65 of file cris.h.

Function Documentation

◆ AO_test_and_set_full()

AO_INLINE AO_TS_VAL_t AO_test_and_set_full ( volatile AO_TS_t addr)

Definition at line 47 of file cris.h.

47 {
48 /* Ripped from linuxthreads/sysdeps/cris/pt-machine.h */
49 register unsigned long int ret;
50
51 /* Note the use of a dummy output of *addr to expose the write. The
52 memory barrier is to stop *other* writes being moved past this code. */
53 __asm__ __volatile__("clearf\n"
54 "0:\n\t"
55 "movu.b [%2],%0\n\t"
56 "ax\n\t"
57 "move.b %3,[%2]\n\t"
58 "bwf 0b\n\t"
59 "clearf"
60 : "=&r" (ret), "=m" (*addr)
61 : "r" (addr), "r" ((int) 1), "m" (*addr)
62 : "memory");
63 return ret;
64}