Changeset 1488 for trunk/src/emx/include/386/builtin.h
- Timestamp:
- Sep 10, 2004, 9:39:57 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/386/builtin.h
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r1487 r1488 299 299 300 300 301 /** 302 * Atomically compare and exchange a 32-bit word. 303 * 304 * @returns 1 if changed, 0 if unchanged (i.e. boolean). 305 * @param pu32 Pointer to the value to compare & exchange. 306 * @param u32New The new value. 307 * @param u32Cur The current value. Only update if *pu32 equals this one. 308 */ 309 static inline unsigned __atomic_cmpxchg32(volatile uint32_t *pu32, uint32_t u32New, uint32_t u32Old) 310 { 311 __asm__ __volatile__("lock cmpxchgl %2, %1\n\t" 312 "setz %%al\n\t" 313 "movzx %%al, %%eax\n\t" 314 : "=a" (u32Old), 315 "=m" (*pu32) 316 : "r" (u32New), 317 "0" (u32Old)); 318 return (unsigned)u32Old; 319 } 320 321 301 322 #define __ROTATE_FUN(F,I,T) \ 302 323 static __inline__ T F (T value, int shift) \ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.