Changeset 449 for soft/giet_vm/giet_kernel/kernel_utils.c
- Timestamp:
- Nov 11, 2014, 4:14:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/kernel_utils.c
r446 r449 162 162 } // end _printf() 163 163 164 /////////////////////////////////////////////////// 165 unsigned int _atomic_increment( unsigned int* ptr ) 166 { 167 unsigned int value; 168 169 asm volatile ( 170 "_atomic_increment_try: \n" 171 "ll $3, 0(%1) \n" 172 "move %0, $3 \n" 173 "addi $3, $3, 1 \n" 174 "sc $3, 0(%1) \n" 175 "beqz $3, _atomic_increment_try \n" 176 : "=r" (value) 177 : "r" (ptr) 178 : "$3", "memory" ); 179 180 return value; 181 } 182 164 183 // Local Variables: 165 184 // tab-width: 4
Note: See TracChangeset
for help on using the changeset viewer.