Lines Matching refs:lock

61  * @lock:   Lock to initialize
63 static inline void cvmx_spinlock_init(cvmx_spinlock_t *lock)
65 lock->value = CVMX_SPINLOCK_UNLOCKED_VAL;
71 * @lock: Lock to check
74 static inline int cvmx_spinlock_locked(cvmx_spinlock_t *lock)
76 return lock->value != CVMX_SPINLOCK_UNLOCKED_VAL;
80 * Releases lock
82 * @lock: pointer to lock structure
84 static inline void cvmx_spinlock_unlock(cvmx_spinlock_t *lock)
87 lock->value = 0;
92 * Attempts to take the lock, but does not spin if lock is not available.
93 * May take some time to acquire the lock even if it is available
96 * @lock: pointer to lock structure
98 * Returns 0: lock successfully taken
99 * 1: lock not taken, held by someone else
103 static inline unsigned int cvmx_spinlock_trylock(cvmx_spinlock_t *lock)
109 /* if lock held, fail immediately */
117 [val] "+m"(lock->value), [tmp] "=&r"(tmp)
124 * Gets lock, spins until lock is taken
126 * @lock: pointer to lock structure
128 static inline void cvmx_spinlock_lock(cvmx_spinlock_t *lock)
140 [val] "+m"(lock->value), [tmp] "=&r"(tmp)
149 * compact data structures as only 1 bit is consumed for the lock.
154 * Gets lock, spins until lock is taken
156 * word used for the lock.
159 * @word: word to lock bit 31 of
183 * Attempts to get lock, returns immediately with success/failure
185 * word used for the lock.
188 * @word: word to lock bit 31 of
189 * Returns 0: lock successfully taken
190 * 1: lock not taken, held by someone else
200 /* if lock held, fail immediately */
217 * Releases bit lock
219 * Unconditionally clears bit 31 of the lock word. Note that this is
221 * of the bits in the word are protected by the lock.