equal
deleted
inserted
replaced
44 ****************************************************************************/ |
44 ****************************************************************************/ |
45 |
45 |
46 #include <QtCore/qglobal.h> |
46 #include <QtCore/qglobal.h> |
47 |
47 |
48 #ifdef QT_HAVE_ARMV6 |
48 #ifdef QT_HAVE_ARMV6 |
|
49 #ifndef SYMBIAN_E32_ATOMIC_API |
49 |
50 |
50 QT_BEGIN_NAMESPACE |
51 QT_BEGIN_NAMESPACE |
51 |
52 |
52 QT_USE_NAMESPACE |
53 QT_USE_NAMESPACE |
53 |
54 |
54 #ifdef Q_CC_RVCT |
55 #ifdef Q_CC_RVCT |
55 #pragma push |
56 #pragma push |
56 #pragma arm |
57 #pragma arm |
|
58 Q_CORE_EXPORT asm |
|
59 bool QBasicAtomicInt_testAndSetRelaxed(volatile int *_q_value, int expectedValue, int newValue) |
|
60 { |
|
61 CODE32 |
|
62 //fall through |
|
63 } |
|
64 Q_CORE_EXPORT asm |
|
65 bool QBasicAtomicInt_testAndSetAcquire(volatile int *_q_value, int expectedValue, int newValue) |
|
66 { |
|
67 CODE32 |
|
68 //fall through |
|
69 } |
|
70 Q_CORE_EXPORT asm |
|
71 bool QBasicAtomicInt_testAndSetRelease(volatile int *_q_value, int expectedValue, int newValue) |
|
72 { |
|
73 CODE32 |
|
74 //fall through |
|
75 } |
57 Q_CORE_EXPORT asm |
76 Q_CORE_EXPORT asm |
58 bool QBasicAtomicInt_testAndSetOrdered(volatile int *_q_value, int expectedValue, int newValue) |
77 bool QBasicAtomicInt_testAndSetOrdered(volatile int *_q_value, int expectedValue, int newValue) |
59 { |
78 { |
60 CODE32 |
79 CODE32 |
61 //R0 = _q_value |
80 //R0 = _q_value |
71 MOVCC r0,#0 |
90 MOVCC r0,#0 |
72 BX r14 |
91 BX r14 |
73 } |
92 } |
74 |
93 |
75 Q_CORE_EXPORT asm |
94 Q_CORE_EXPORT asm |
|
95 int QBasicAtomicInt_fetchAndStoreRelaxed(volatile int *_q_value, int newValue) |
|
96 { |
|
97 CODE32 |
|
98 //fall through |
|
99 } |
|
100 Q_CORE_EXPORT asm |
|
101 int QBasicAtomicInt_fetchAndStoreAcquire(volatile int *_q_value, int newValue) |
|
102 { |
|
103 CODE32 |
|
104 //fall through |
|
105 } |
|
106 Q_CORE_EXPORT asm |
|
107 int QBasicAtomicInt_fetchAndStoreRelease(volatile int *_q_value, int newValue) |
|
108 { |
|
109 CODE32 |
|
110 //fall through |
|
111 } |
|
112 Q_CORE_EXPORT asm |
76 int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *_q_value, int newValue) |
113 int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *_q_value, int newValue) |
77 { |
114 { |
78 CODE32 |
115 CODE32 |
79 //R0 = _q_value |
116 //R0 = _q_value |
80 //R1 = newValue |
117 //R1 = newValue |
85 BNE retry_fetchAndStoreOrdered //then goto retry |
122 BNE retry_fetchAndStoreOrdered //then goto retry |
86 MOV r0,r3 //return r3 |
123 MOV r0,r3 //return r3 |
87 BX r14 |
124 BX r14 |
88 } |
125 } |
89 |
126 |
|
127 Q_CORE_EXPORT asm |
|
128 int QBasicAtomicInt_fetchAndAddRelaxed(volatile int *_q_value, int valueToAdd) |
|
129 { |
|
130 CODE32 |
|
131 //fall through |
|
132 } |
|
133 Q_CORE_EXPORT asm |
|
134 int QBasicAtomicInt_fetchAndAddAcquire(volatile int *_q_value, int valueToAdd) |
|
135 { |
|
136 CODE32 |
|
137 //fall through |
|
138 } |
|
139 Q_CORE_EXPORT asm |
|
140 int QBasicAtomicInt_fetchAndAddRelease(volatile int *_q_value, int valueToAdd) |
|
141 { |
|
142 CODE32 |
|
143 //fall through |
|
144 } |
90 Q_CORE_EXPORT asm |
145 Q_CORE_EXPORT asm |
91 int QBasicAtomicInt_fetchAndAddOrdered(volatile int *_q_value, int valueToAdd) |
146 int QBasicAtomicInt_fetchAndAddOrdered(volatile int *_q_value, int valueToAdd) |
92 { |
147 { |
93 CODE32 |
148 CODE32 |
94 //R0 = _q_value |
149 //R0 = _q_value |
102 BNE retry_fetchAndAddOrdered //then retry |
157 BNE retry_fetchAndAddOrdered //then retry |
103 MOV r0,r2 //return r2 |
158 MOV r0,r2 //return r2 |
104 LDMIA sp!,{r12,pc} |
159 LDMIA sp!,{r12,pc} |
105 } |
160 } |
106 |
161 |
|
162 Q_CORE_EXPORT asm |
|
163 bool QBasicAtomicPointer_testAndSetRelaxed(void * volatile *_q_value, |
|
164 void *expectedValue, |
|
165 void *newValue) |
|
166 { |
|
167 CODE32 |
|
168 //fall through |
|
169 } |
|
170 Q_CORE_EXPORT asm |
|
171 bool QBasicAtomicPointer_testAndSetRelease(void * volatile *_q_value, |
|
172 void *expectedValue, |
|
173 void *newValue) |
|
174 { |
|
175 CODE32 |
|
176 //fall through |
|
177 } |
|
178 Q_CORE_EXPORT asm |
|
179 bool QBasicAtomicPointer_testAndSetAcquire(void * volatile *_q_value, |
|
180 void *expectedValue, |
|
181 void *newValue) |
|
182 { |
|
183 CODE32 |
|
184 //fall through |
|
185 } |
107 Q_CORE_EXPORT asm |
186 Q_CORE_EXPORT asm |
108 bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *_q_value, |
187 bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *_q_value, |
109 void *expectedValue, |
188 void *expectedValue, |
110 void *newValue) |
189 void *newValue) |
111 { |
190 { |
123 MOVCC r0,#0 |
202 MOVCC r0,#0 |
124 BX r14 |
203 BX r14 |
125 } |
204 } |
126 |
205 |
127 Q_CORE_EXPORT asm |
206 Q_CORE_EXPORT asm |
|
207 void *QBasicAtomicPointer_fetchAndStoreRelaxed(void * volatile *_q_value, void *newValue) |
|
208 { |
|
209 CODE32 |
|
210 //fall through |
|
211 } |
|
212 Q_CORE_EXPORT asm |
|
213 void *QBasicAtomicPointer_fetchAndStoreAcquire(void * volatile *_q_value, void *newValue) |
|
214 { |
|
215 CODE32 |
|
216 //fall through |
|
217 } |
|
218 Q_CORE_EXPORT asm |
|
219 void *QBasicAtomicPointer_fetchAndStoreRelease(void * volatile *_q_value, void *newValue) |
|
220 { |
|
221 CODE32 |
|
222 //fall through |
|
223 } |
|
224 Q_CORE_EXPORT asm |
128 void *QBasicAtomicPointer_fetchAndStoreOrdered(void * volatile *_q_value, void *newValue) |
225 void *QBasicAtomicPointer_fetchAndStoreOrdered(void * volatile *_q_value, void *newValue) |
129 { |
226 { |
130 CODE32 |
227 CODE32 |
131 //R0 = _q_value |
228 //R0 = _q_value |
132 //R1 = newValue |
229 //R1 = newValue |
137 BNE retryPointer_fetchAndStoreOrdered //then goto retry |
234 BNE retryPointer_fetchAndStoreOrdered //then goto retry |
138 MOV r0,r3 //return r3 |
235 MOV r0,r3 //return r3 |
139 BX r14 |
236 BX r14 |
140 } |
237 } |
141 |
238 |
|
239 Q_CORE_EXPORT asm |
|
240 void *QBasicAtomicPointer_fetchAndAddRelaxed(void * volatile *_q_value, qptrdiff valueToAdd) |
|
241 { |
|
242 CODE32 |
|
243 //fall through |
|
244 } |
|
245 Q_CORE_EXPORT asm |
|
246 void *QBasicAtomicPointer_fetchAndAddRelease(void * volatile *_q_value, qptrdiff valueToAdd) |
|
247 { |
|
248 CODE32 |
|
249 //fall through |
|
250 } |
|
251 Q_CORE_EXPORT asm |
|
252 void *QBasicAtomicPointer_fetchAndAddAcquire(void * volatile *_q_value, qptrdiff valueToAdd) |
|
253 { |
|
254 CODE32 |
|
255 //fall through |
|
256 } |
142 Q_CORE_EXPORT asm |
257 Q_CORE_EXPORT asm |
143 void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *_q_value, qptrdiff valueToAdd) |
258 void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *_q_value, qptrdiff valueToAdd) |
144 { |
259 { |
145 CODE32 |
260 CODE32 |
146 //R0 = _q_value |
261 //R0 = _q_value |
156 LDMIA sp!,{r12,pc} |
271 LDMIA sp!,{r12,pc} |
157 } |
272 } |
158 |
273 |
159 #pragma pop |
274 #pragma pop |
160 #elif defined (Q_CC_GCCE) |
275 #elif defined (Q_CC_GCCE) |
|
276 Q_CORE_EXPORT __declspec( naked ) |
|
277 bool QBasicAtomicInt_testAndSetRelaxed(volatile int *_q_value, int expectedValue, int newValue) |
|
278 { |
|
279 //fall through |
|
280 } |
|
281 Q_CORE_EXPORT __declspec( naked ) |
|
282 bool QBasicAtomicInt_testAndSetAcquire(volatile int *_q_value, int expectedValue, int newValue) |
|
283 { |
|
284 //fall through |
|
285 } |
|
286 Q_CORE_EXPORT __declspec( naked ) |
|
287 bool QBasicAtomicInt_testAndSetRelease(volatile int *_q_value, int expectedValue, int newValue) |
|
288 { |
|
289 //fall through |
|
290 } |
161 Q_CORE_EXPORT __declspec( naked ) |
291 Q_CORE_EXPORT __declspec( naked ) |
162 bool QBasicAtomicInt_testAndSetOrdered(volatile int *_q_value, int expectedValue, int newValue) |
292 bool QBasicAtomicInt_testAndSetOrdered(volatile int *_q_value, int expectedValue, int newValue) |
163 { |
293 { |
164 //R0 = _q_value |
294 //R0 = _q_value |
165 //R1 = expectedValue |
295 //R1 = expectedValue |
174 asm(" MOVCC r0,#0"); |
304 asm(" MOVCC r0,#0"); |
175 asm(" BX r14"); |
305 asm(" BX r14"); |
176 } |
306 } |
177 |
307 |
178 Q_CORE_EXPORT __declspec( naked ) |
308 Q_CORE_EXPORT __declspec( naked ) |
|
309 int QBasicAtomicInt_fetchAndStoreRelaxed(volatile int *_q_value, int newValue) |
|
310 { |
|
311 //fall through |
|
312 } |
|
313 Q_CORE_EXPORT __declspec( naked ) |
|
314 int QBasicAtomicInt_fetchAndStoreAcquire(volatile int *_q_value, int newValue) |
|
315 { |
|
316 //fall through |
|
317 } |
|
318 Q_CORE_EXPORT __declspec( naked ) |
|
319 int QBasicAtomicInt_fetchAndStoreRelease(volatile int *_q_value, int newValue) |
|
320 { |
|
321 //fall through |
|
322 } |
|
323 Q_CORE_EXPORT __declspec( naked ) |
179 int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *_q_value, int newValue) |
324 int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *_q_value, int newValue) |
180 { |
325 { |
181 //R0 = _q_value |
326 //R0 = _q_value |
182 //R1 = newValue |
327 //R1 = newValue |
183 asm("retry_fetchAndStoreOrdered:"); |
328 asm("retry_fetchAndStoreOrdered:"); |
187 asm(" BNE retry_fetchAndStoreOrdered"); //then goto retry |
332 asm(" BNE retry_fetchAndStoreOrdered"); //then goto retry |
188 asm(" MOV r0,r3"); //return r3 |
333 asm(" MOV r0,r3"); //return r3 |
189 asm(" BX r14"); |
334 asm(" BX r14"); |
190 } |
335 } |
191 |
336 |
|
337 Q_CORE_EXPORT __declspec( naked ) |
|
338 int QBasicAtomicInt_fetchAndAddRelaxed(volatile int *_q_value, int valueToAdd) |
|
339 { |
|
340 //fall through |
|
341 } |
|
342 Q_CORE_EXPORT __declspec( naked ) |
|
343 int QBasicAtomicInt_fetchAndAddAcquire(volatile int *_q_value, int valueToAdd) |
|
344 { |
|
345 //fall through |
|
346 } |
|
347 Q_CORE_EXPORT __declspec( naked ) |
|
348 int QBasicAtomicInt_fetchAndAddRelease(volatile int *_q_value, int valueToAdd) |
|
349 { |
|
350 //fall through |
|
351 } |
192 Q_CORE_EXPORT __declspec( naked ) |
352 Q_CORE_EXPORT __declspec( naked ) |
193 int QBasicAtomicInt_fetchAndAddOrdered(volatile int *_q_value, int valueToAdd) |
353 int QBasicAtomicInt_fetchAndAddOrdered(volatile int *_q_value, int valueToAdd) |
194 { |
354 { |
195 //R0 = _q_value |
355 //R0 = _q_value |
196 //R1 = valueToAdd |
356 //R1 = valueToAdd |
203 asm(" BNE retry_fetchAndAddOrdered"); //then retry |
363 asm(" BNE retry_fetchAndAddOrdered"); //then retry |
204 asm(" MOV r0,r2"); //return r2 |
364 asm(" MOV r0,r2"); //return r2 |
205 asm(" LDMIA sp!,{r12,pc}"); |
365 asm(" LDMIA sp!,{r12,pc}"); |
206 } |
366 } |
207 |
367 |
|
368 Q_CORE_EXPORT __declspec( naked ) |
|
369 bool QBasicAtomicPointer_testAndSetRelaxed(void * volatile *_q_value, |
|
370 void *expectedValue, |
|
371 void *newValue) |
|
372 { |
|
373 //fall through |
|
374 } |
|
375 Q_CORE_EXPORT __declspec( naked ) |
|
376 bool QBasicAtomicPointer_testAndSetRelease(void * volatile *_q_value, |
|
377 void *expectedValue, |
|
378 void *newValue) |
|
379 { |
|
380 //fall through |
|
381 } |
|
382 Q_CORE_EXPORT __declspec( naked ) |
|
383 bool QBasicAtomicPointer_testAndSetAcquire(void * volatile *_q_value, |
|
384 void *expectedValue, |
|
385 void *newValue) |
|
386 { |
|
387 //fall through |
|
388 } |
208 Q_CORE_EXPORT __declspec( naked ) |
389 Q_CORE_EXPORT __declspec( naked ) |
209 bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *_q_value, |
390 bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *_q_value, |
210 void *expectedValue, |
391 void *expectedValue, |
211 void *newValue) |
392 void *newValue) |
212 { |
393 { |
223 asm(" MOVCC r0,#0"); |
404 asm(" MOVCC r0,#0"); |
224 asm(" BX r14"); |
405 asm(" BX r14"); |
225 } |
406 } |
226 |
407 |
227 Q_CORE_EXPORT __declspec( naked ) |
408 Q_CORE_EXPORT __declspec( naked ) |
|
409 void *QBasicAtomicPointer_fetchAndStoreRelaxed(void * volatile *_q_value, void *newValue) |
|
410 { |
|
411 //fall through |
|
412 } |
|
413 Q_CORE_EXPORT __declspec( naked ) |
|
414 void *QBasicAtomicPointer_fetchAndStoreAcquire(void * volatile *_q_value, void *newValue) |
|
415 { |
|
416 //fall through |
|
417 } |
|
418 Q_CORE_EXPORT __declspec( naked ) |
|
419 void *QBasicAtomicPointer_fetchAndStoreRelease(void * volatile *_q_value, void *newValue) |
|
420 { |
|
421 //fall through |
|
422 } |
|
423 Q_CORE_EXPORT __declspec( naked ) |
228 void *QBasicAtomicPointer_fetchAndStoreOrdered(void * volatile *_q_value, void *newValue) |
424 void *QBasicAtomicPointer_fetchAndStoreOrdered(void * volatile *_q_value, void *newValue) |
229 { |
425 { |
230 //R0 = _q_value |
426 //R0 = _q_value |
231 //R1 = newValue |
427 //R1 = newValue |
232 asm("retryPointer_fetchAndStoreOrdered:"); |
428 asm("retryPointer_fetchAndStoreOrdered:"); |
236 asm(" BNE retryPointer_fetchAndStoreOrdered"); //then goto retry |
432 asm(" BNE retryPointer_fetchAndStoreOrdered"); //then goto retry |
237 asm(" MOV r0,r3"); //return r3 |
433 asm(" MOV r0,r3"); //return r3 |
238 asm(" BX r14"); |
434 asm(" BX r14"); |
239 } |
435 } |
240 |
436 |
|
437 Q_CORE_EXPORT __declspec( naked ) |
|
438 void *QBasicAtomicPointer_fetchAndAddRelaxed(void * volatile *_q_value, qptrdiff valueToAdd) |
|
439 { |
|
440 //fall through |
|
441 } |
|
442 Q_CORE_EXPORT __declspec( naked ) |
|
443 void *QBasicAtomicPointer_fetchAndAddRelease(void * volatile *_q_value, qptrdiff valueToAdd) |
|
444 { |
|
445 //fall through |
|
446 } |
|
447 Q_CORE_EXPORT __declspec( naked ) |
|
448 void *QBasicAtomicPointer_fetchAndAddAcquire(void * volatile *_q_value, qptrdiff valueToAdd) |
|
449 { |
|
450 //fall through |
|
451 } |
241 Q_CORE_EXPORT __declspec( naked ) |
452 Q_CORE_EXPORT __declspec( naked ) |
242 void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *_q_value, qptrdiff valueToAdd) |
453 void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *_q_value, qptrdiff valueToAdd) |
243 { |
454 { |
244 //R0 = _q_value |
455 //R0 = _q_value |
245 //R1 = valueToAdd |
456 //R1 = valueToAdd |
256 #else |
467 #else |
257 #error unknown arm compiler |
468 #error unknown arm compiler |
258 #endif |
469 #endif |
259 QT_END_NAMESPACE |
470 QT_END_NAMESPACE |
260 #endif |
471 #endif |
|
472 #endif |