MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cvmx_spinlock_lock

Function cvmx_spinlock_lock

freebsd/contrib/octeon-sdk/cvmx-spinlock.h:160–177  ·  view source on GitHub ↗

* Gets lock, spins until lock is taken * * @param lock pointer to lock structure */

Source from the content-addressed store, hash-verified

158 * @param lock pointer to lock structure
159 */
160static inline void cvmx_spinlock_lock(cvmx_spinlock_t *lock)
161{
162 unsigned int tmp;
163
164 __asm__ __volatile__(
165 ".set noreorder \n"
166 "1: ll %[tmp], %[val] \n"
167 " bnez %[tmp], 1b \n"
168 " li %[tmp], 1 \n"
169 " sc %[tmp], %[val] \n"
170 " beqz %[tmp], 1b \n"
171 " nop \n"
172 ".set reorder \n"
173 : [val] "+m" (lock->value), [tmp] "=&r" (tmp)
174 :
175 : "memory");
176
177}
178
179
180

Callers 15

cvmx_l2c_lock_lineFunction · 0.85
cvmx_l2c_flush_lineFunction · 0.85
cvmx_l2c_vrt_memprotectFunction · 0.85
simprintfFunction · 0.85
mainFunction · 0.85
__smdr_newFunction · 0.85
__smdr_initFunction · 0.85
cvmx_shmem_showFunction · 0.85
octeon_pci_console_writeFunction · 0.85
octeon_pci_console_readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected