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

Go to the source code of this file.

Macros

#define AO_HAVE_test_and_set_full
 
#define AO_HAVE_compare_and_swap_full
 
#define AO_T_IS_INT
 

Functions

AO_INLINE AO_TS_VAL_t AO_test_and_set_full (volatile AO_TS_t *addr)
 
AO_INLINE int AO_compare_and_swap_full (volatile AO_t *addr, AO_t old, AO_t new_val)
 

Macro Definition Documentation

◆ AO_HAVE_compare_and_swap_full

#define AO_HAVE_compare_and_swap_full

Definition at line 67 of file avr32.h.

◆ AO_HAVE_test_and_set_full

#define AO_HAVE_test_and_set_full

Definition at line 45 of file avr32.h.

◆ AO_T_IS_INT

#define AO_T_IS_INT

Definition at line 71 of file avr32.h.

Function Documentation

◆ AO_compare_and_swap_full()

AO_INLINE int AO_compare_and_swap_full ( volatile AO_t addr,
AO_t  old,
AO_t  new_val 
)

Definition at line 49 of file avr32.h.

50{
51 register long ret;
52
53 __asm__ __volatile__(
54 "1: ssrf 5\n"
55 " ld.w %[res], %[mem]\n"
56 " eor %[res], %[oldval]\n"
57 " brne 2f\n"
58 " stcond %[mem], %[newval]\n"
59 " brne 1b\n"
60 "2:\n"
61 : [res] "=&r"(ret), [mem] "=m"(*addr)
62 : "m"(*addr), [newval] "r"(new_val), [oldval] "r"(old)
63 : "cc", "memory");
64
65 return (int)ret;
66}

◆ AO_test_and_set_full()

AO_INLINE AO_TS_VAL_t AO_test_and_set_full ( volatile AO_TS_t addr)

Definition at line 33 of file avr32.h.

34 {
35 register long ret;
36
37 __asm__ __volatile__(
38 "xchg %[oldval], %[mem], %[newval]"
39 : [oldval] "=&r"(ret)
40 : [mem] "r"(addr), [newval] "r"(1)
41 : "memory");
42
43 return (AO_TS_VAL_t)ret;
44 }
#define AO_TS_VAL_t
Definition: gcc/hppa.h:44