Changeset 11 for trunk/kernel/libk/remote_spinlock.h
- Timestamp:
- Apr 26, 2017, 2:29:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_spinlock.h
r1 r11 48 48 * This function initializes a remote spinlock. 49 49 *************************************************************************************** 50 * @ lock 50 * @ lock_xp : extended pointer on the remote spinlock 51 51 **************************************************************************************/ 52 void remote_spinlock_init( xptr_t lock ); 52 void remote_spinlock_init( xptr_t lock_xp ); 53 54 /******************************************************************************************* 55 * This blocking function uses a busy waiting strategy to lock a remote spinlock. 56 * It polls the lock and returns only when the lock has been taken. 57 * All IRQs are disabled and will keep disabled until the lock is released. 58 * It increments the calling thread local_locks count when the lock has been taken. 59 ******************************************************************************************* 60 * @ lock_xp : extended pointer on the remote spinlock. 61 * @ irq_state : buffer to save the SR state (in the calling thread stack) 62 ******************************************************************************************/ 63 void remote_spinlock_lock_busy( xptr_t lock_xp, 64 uint32_t * irq_state ); 65 66 /******************************************************************************************* 67 * This function releases a remote busy_waiting spinlock. 68 * It restores the CPU SR state. 69 ******************************************************************************************* 70 * @ lock_xp : extended pointer on remote spinlock. 71 * @ irq_state : value to be resrored in CPU SR 72 ******************************************************************************************/ 73 void remote_spinlock_unlock_busy( xptr_t lock_xp, 74 uint32_t irq_state ); 53 75 54 76 /*************************************************************************************** … … 58 80 * It increments the calling thread locks count when the lock has been taken. 59 81 *************************************************************************************** 60 * @ lock 82 * @ lock_xp : extended pointer on the remote spinlock 61 83 **************************************************************************************/ 62 void remote_spinlock_lock( xptr_t lock );84 void remote_spinlock_lock( xptr_t lock_xp ); 63 85 64 86 /*************************************************************************************** … … 66 88 * It increments the calling thread locks count in case of success. 67 89 *************************************************************************************** 68 * @ lock : extended pointer on the remote spinlock90 * @ lock_xp : extended pointer on the remote spinlock 69 91 * @ returns O if success / returns non zero if lock already taken. 70 92 **************************************************************************************/ 71 uint32_t remote_spinlock_trylock( xptr_t lock);93 error_t remote_spinlock_trylock( xptr_t lock_xp ); 72 94 73 95 /*************************************************************************************** 74 96 * This function releases a remote spinlock. 75 97 *************************************************************************************** 76 * @ lock : extended pointer on the remote spinlock98 * @ lock_xp : extended pointer on the remote spinlock 77 99 **************************************************************************************/ 78 void remote_spinlock_unlock( xptr_t lock);100 void remote_spinlock_unlock( xptr_t lock_xp ); 79 101 80 102 #endif
Note: See TracChangeset
for help on using the changeset viewer.