| 106 | } |
| 107 | |
| 108 | static __inline void |
| 109 | atomic_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 | |
| 130 | static __inline void |
| 131 | atomic_add_long(volatile u_long *p, u_long val) |
no outgoing calls
no test coverage detected