Go to the source code of this file.
◆ AO_HAVE_fetch_compare_and_swap
| #define AO_HAVE_fetch_compare_and_swap |
◆ AO_HAVE_fetch_compare_and_swap_acquire
| #define AO_HAVE_fetch_compare_and_swap_acquire |
◆ AO_HAVE_fetch_compare_and_swap_full
| #define AO_HAVE_fetch_compare_and_swap_full |
◆ AO_HAVE_fetch_compare_and_swap_release
| #define AO_HAVE_fetch_compare_and_swap_release |
◆ AO_HAVE_load_acquire
| #define AO_HAVE_load_acquire |
◆ AO_HAVE_nop_read
◆ AO_HAVE_nop_write
| #define AO_HAVE_nop_write |
◆ AO_HAVE_store_release
| #define AO_HAVE_store_release |
◆ AO_HAVE_test_and_set
| #define AO_HAVE_test_and_set |
◆ AO_HAVE_test_and_set_acquire
| #define AO_HAVE_test_and_set_acquire |
◆ AO_HAVE_test_and_set_full
| #define AO_HAVE_test_and_set_full |
◆ AO_HAVE_test_and_set_release
| #define AO_HAVE_test_and_set_release |
◆ AO_nop_read
◆ AO_nop_write
◆ AO_fetch_compare_and_swap()
Definition at line 122 of file ibmc/powerpc.h.
123{
125# if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__)
126 __asm__ __volatile__(
127 "1:ldarx %0,0,%1\n"
128 "cmpd %0, %3\n"
129 "bne 2f\n"
130 "stdcx. %2,0,%1\n"
131 "bne- 1b\n"
132 "2:\n"
133 : "=&r"(fetched_val)
134 : "r"(addr), "r"(new_val), "r"(old_val)
135 : "memory", "cr0");
136# else
137 __asm__ __volatile__(
138 "1:lwarx %0,0,%1\n"
139 "cmpw %0, %3\n"
140 "bne 2f\n"
141 "stwcx. %2,0,%1\n"
142 "bne- 1b\n"
143 "2:\n"
144 : "=&r"(fetched_val)
145 : "r"(addr), "r"(new_val), "r"(old_val)
146 : "memory", "cr0");
147# endif
148 return fetched_val;
149}
◆ AO_fetch_compare_and_swap_acquire()
Definition at line 153 of file ibmc/powerpc.h.
155{
159}
AO_INLINE AO_t AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val)
◆ AO_fetch_compare_and_swap_full()
◆ AO_fetch_compare_and_swap_release()
◆ AO_load_acquire()
◆ AO_lwsync()
Definition at line 59 of file gcc/powerpc.h.
60{
61#ifdef __NO_LWSYNC__
62 __asm__ __volatile__("sync" : : : "memory");
63#else
64 __asm__ __volatile__("lwsync" : : : "memory");
65#endif
66}
◆ AO_store_release()
◆ AO_sync()
◆ AO_test_and_set()
Definition at line 60 of file ibmc/powerpc.h.
60 {
61#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__)
62
63 unsigned long oldval;
64 unsigned long temp = 1;
65
66 __asm__ __volatile__(
67 "1:ldarx %0,0,%1\n"
68 "cmpdi %0, 0\n"
69 "bne 2f\n"
70 "stdcx. %2,0,%1\n"
71 "bne- 1b\n"
72 "2:\n"
73 : "=&r"(oldval)
74 : "r"(addr), "r"(temp)
75 : "memory", "cr0");
76#else
77 int oldval;
78 int temp = 1;
79
80 __asm__ __volatile__(
81 "1:lwarx %0,0,%1\n"
82 "cmpwi %0, 0\n"
83 "bne 2f\n"
84 "stwcx. %2,0,%1\n"
85 "bne- 1b\n"
86 "2:\n"
87 : "=&r"(oldval)
88 : "r"(addr), "r"(temp)
89 : "memory", "cr0");
90#endif
92}
◆ AO_test_and_set_acquire()
Definition at line 96 of file ibmc/powerpc.h.
96 {
100}
AO_INLINE AO_TS_VAL_t AO_test_and_set(volatile AO_TS_t *addr)
◆ AO_test_and_set_full()
◆ AO_test_and_set_release()