72 inline static jint add (jint add_value, volatile jint* dest); |
72 inline static jint add (jint add_value, volatile jint* dest); |
73 inline static size_t add (size_t add_value, volatile size_t* dest); |
73 inline static size_t add (size_t add_value, volatile size_t* dest); |
74 inline static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest); |
74 inline static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest); |
75 inline static void* add_ptr(intptr_t add_value, volatile void* dest); |
75 inline static void* add_ptr(intptr_t add_value, volatile void* dest); |
76 // See comment above about using jlong atomics on 32-bit platforms |
76 // See comment above about using jlong atomics on 32-bit platforms |
77 static jlong add (jlong add_value, volatile jlong* dest); |
77 static jlong add (jlong add_value, volatile jlong* dest); |
78 |
78 |
79 // Atomically increment location. inc*() provide: |
79 // Atomically increment location. inc*() provide: |
80 // <fence> increment-dest <membar StoreLoad|StoreStore> |
80 // <fence> increment-dest <membar StoreLoad|StoreStore> |
81 inline static void inc (volatile jint* dest); |
81 inline static void inc (volatile jint* dest); |
82 static void inc (volatile jshort* dest); |
82 static void inc (volatile jshort* dest); |
83 inline static void inc (volatile size_t* dest); |
83 inline static void inc (volatile size_t* dest); |
84 inline static void inc_ptr(volatile intptr_t* dest); |
84 inline static void inc_ptr(volatile intptr_t* dest); |
85 inline static void inc_ptr(volatile void* dest); |
85 inline static void inc_ptr(volatile void* dest); |
86 |
86 |
87 // Atomically decrement a location. dec*() provide: |
87 // Atomically decrement a location. dec*() provide: |
88 // <fence> decrement-dest <membar StoreLoad|StoreStore> |
88 // <fence> decrement-dest <membar StoreLoad|StoreStore> |
89 inline static void dec (volatile jint* dest); |
89 inline static void dec (volatile jint* dest); |
90 static void dec (volatile jshort* dest); |
90 static void dec (volatile jshort* dest); |
91 inline static void dec (volatile size_t* dest); |
91 inline static void dec (volatile size_t* dest); |
92 inline static void dec_ptr(volatile intptr_t* dest); |
92 inline static void dec_ptr(volatile intptr_t* dest); |
93 inline static void dec_ptr(volatile void* dest); |
93 inline static void dec_ptr(volatile void* dest); |
94 |
94 |
95 // Performs atomic exchange of *dest with exchange_value. Returns old |
95 // Performs atomic exchange of *dest with exchange_value. Returns old |
96 // prior value of *dest. xchg*() provide: |
96 // prior value of *dest. xchg*() provide: |
97 // <fence> exchange-value-with-dest <membar StoreLoad|StoreStore> |
97 // <fence> exchange-value-with-dest <membar StoreLoad|StoreStore> |
98 inline static jint xchg(jint exchange_value, volatile jint* dest); |
98 inline static jint xchg(jint exchange_value, volatile jint* dest); |
99 static unsigned int xchg(unsigned int exchange_value, volatile unsigned int* dest); |
99 static unsigned int xchg(unsigned int exchange_value, volatile unsigned int* dest); |
100 |
100 |
101 inline static intptr_t xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest); |
101 inline static intptr_t xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest); |
102 inline static void* xchg_ptr(void* exchange_value, volatile void* dest); |
102 inline static void* xchg_ptr(void* exchange_value, volatile void* dest); |
103 |
103 |
104 // Performs atomic compare of *dest and compare_value, and exchanges |
104 // Performs atomic compare of *dest and compare_value, and exchanges |
105 // *dest with exchange_value if the comparison succeeded. Returns prior |
105 // *dest with exchange_value if the comparison succeeded. Returns prior |
106 // value of *dest. cmpxchg*() provide: |
106 // value of *dest. cmpxchg*() provide: |
107 // <fence> compare-and-exchange <membar StoreLoad|StoreStore> |
107 // <fence> compare-and-exchange <membar StoreLoad|StoreStore> |
108 static jbyte cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value); |
108 static jbyte cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value); |
109 inline static jint cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value); |
109 inline static jint cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value); |
110 // See comment above about using jlong atomics on 32-bit platforms |
110 // See comment above about using jlong atomics on 32-bit platforms |
111 inline static jlong cmpxchg (jlong exchange_value, volatile jlong* dest, jlong compare_value); |
111 inline static jlong cmpxchg (jlong exchange_value, volatile jlong* dest, jlong compare_value); |
112 |
112 |
113 static unsigned int cmpxchg(unsigned int exchange_value, |
113 static unsigned int cmpxchg(unsigned int exchange_value, |
114 volatile unsigned int* dest, |
114 volatile unsigned int* dest, |
115 unsigned int compare_value); |
115 unsigned int compare_value); |
116 |
116 |
117 inline static intptr_t cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value); |
117 inline static intptr_t cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value); |
118 inline static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value); |
118 inline static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value); |
119 }; |
119 }; |
120 |
120 |