Changeset 06e1e95 in mainline for kernel/arch/sparc64/include/atomic.h
- Timestamp:
- 2006-09-14T17:09:21Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1d1f5d3
- Parents:
- e5ecc02
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/atomic.h
re5ecc02 r06e1e95 51 51 { 52 52 uint64_t a, b; 53 volatile uint64_t x = (uint64_t) &val->count;54 53 55 __asm__ volatile ( 56 "0:\n" 57 "ldx %0, %1\n" 58 "add %1, %3, %2\n" 59 "casx %0, %1, %2\n" 60 "cmp %1, %2\n" 61 "bne 0b\n" /* The operation failed and must be attempted again if a != b. */ 62 "nop\n" 63 : "=m" (*((uint64_t *)x)), "=r" (a), "=r" (b) 64 : "r" (i) 65 ); 54 do { 55 volatile uintptr_t x = (uint64_t) &val->count; 56 57 a = *((uint64_t *) x); 58 b = a + i; 59 __asm__ volatile ("casx %0, %1, %2\n": "+m" (*((uint64_t *)x)), "+r" (a), "+r" (b)); 60 } while (a != b); 66 61 67 62 return a;
Note:
See TracChangeset
for help on using the changeset viewer.