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

Function atomic_add_64

freebsd/arm/include/atomic-v6.h:108–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108static __inline void
109atomic_add_64(volatile uint64_t *p, uint64_t val)
110{
111 uint64_t tmp;
112 uint32_t exflag;
113
114 __asm __volatile(
115 "1: \n"
116 " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n"
117 " adds %Q[tmp], %Q[val] \n"
118 " adc %R[tmp], %R[tmp], %R[val] \n"
119 " strexd %[exf], %Q[tmp], %R[tmp], [%[ptr]] \n"
120 " teq %[exf], #0 \n"
121 " it ne \n"
122 " bne 1b \n"
123 : [exf] "=&r" (exflag),
124 [tmp] "=&r" (tmp)
125 : [ptr] "r" (p),
126 [val] "r" (val)
127 : "cc", "memory");
128}
129
130static __inline void
131atomic_add_long(volatile u_long *p, u_long val)

Callers 2

counter_u64_addFunction · 0.70
counter_u64_addFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected