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

Function atomic_set_64

freebsd/mips/include/atomic.h:190–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189#if defined(__mips_n64) || defined(__mips_n32)
190static __inline void
191atomic_set_64(__volatile uint64_t *p, uint64_t v)
192{
193 uint64_t temp;
194
195 __asm __volatile (
196 "1:\n\t"
197 "lld %0, %3\n\t" /* load old value */
198 "or %0, %2, %0\n\t" /* calculate new value */
199 "scd %0, %1\n\t" /* attempt to store */
200 "beqz %0, 1b\n\t" /* spin if failed */
201 : "=&r" (temp), "=m" (*p)
202 : "r" (v), "m" (*p)
203 : "memory");
204
205}
206
207static __inline void
208atomic_clear_64(__volatile uint64_t *p, uint64_t v)

Callers 1

vm_page_bits_setFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected