Changeset 165 for soft/giet_vm/libs/spin_lock.c
- Timestamp:
- Jul 4, 2012, 2:51:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/libs/spin_lock.c
r159 r165 28 28 // If the lock is already taken a random delay is introduced before retry. 29 29 /////////////////////////////////////////////////////////////////////////////////// 30 void lock_acquire( giet_lock_t* lock )30 void lock_acquire( giet_lock_t* lock ) 31 31 { 32 unsigned in *tplock = &lock->value;32 unsigned int* plock = &lock->value; 33 33 34 34 asm volatile ( … … 41 41 42 42 "giet_lock_delay: \n" 43 "jal rand \n" /*rand() system call */43 "jal giet_rand \n" /* giet_rand() system call */ 44 44 "nop \n" 45 "andi $4, $2, 0xFF \n" /* $4 <= randomdelay < 256 cycles */45 "andi $4, $2, 0xFF \n" /* $4 <= delay < 256 cycles */ 46 46 47 47 "giet_lock_loop: \n"
Note: See TracChangeset
for help on using the changeset viewer.