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

Function atomic_cmpset_64_i386

freebsd/i386/include/atomic.h:379–406  ·  view source on GitHub ↗

I486 does not support SMP or CMPXCHG8B. */

Source from the content-addressed store, hash-verified

377
378/* I486 does not support SMP or CMPXCHG8B. */
379static __inline int
380atomic_cmpset_64_i386(volatile uint64_t *dst, uint64_t expect, uint64_t src)
381{
382 volatile uint32_t *p;
383 u_char res;
384
385 p = (volatile uint32_t *)dst;
386 __asm __volatile(
387 " pushfl ; "
388 " cli ; "
389 " xorl %1,%%eax ; "
390 " xorl %2,%%edx ; "
391 " orl %%edx,%%eax ; "
392 " jne 1f ; "
393 " movl %4,%1 ; "
394 " movl %5,%2 ; "
395 "1: "
396 " sete %3 ; "
397 " popfl"
398 : "+A" (expect), /* 0 */
399 "+m" (*p), /* 1 */
400 "+m" (*(p + 1)), /* 2 */
401 "=q" (res) /* 3 */
402 : "r" ((uint32_t)src), /* 4 */
403 "r" ((uint32_t)(src >> 32)) /* 5 */
404 : "memory", "cc");
405 return (res);
406}
407
408static __inline int
409atomic_fcmpset_64_i386(volatile uint64_t *dst, uint64_t *expect, uint64_t src)

Callers 2

atomic_fcmpset_64_i386Function · 0.85
atomic_cmpset_64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected