Changeset 1984 for trunk/src/emx/include/386/builtin.h
- Timestamp:
- May 8, 2005, 2:11:22 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/src/emx/include/386/builtin.h (modified) (11 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/386/builtin.h
-
Property cvs2svn:cvs-rev
changed from
1.10to1.11
r1983 r1984 77 77 static __inline__ int __atomic_set_bit(__volatile__ void *pv, unsigned uBit) 78 78 { 79 __asm__ __volatile__("lock btsl %2, %1\n\t"79 __asm__ __volatile__("lock btsl %2, %1\n\t" 80 80 "sbbl %0,%0" 81 81 : "=r" (uBit), … … 95 95 static __inline__ void __atomic_clear_bit(__volatile__ void *pv, unsigned uBit) 96 96 { 97 __asm__ __volatile__("lock btrl %1, %0"97 __asm__ __volatile__("lock btrl %1, %0" 98 98 : "=m" (*(__volatile__ unsigned *)pv) 99 99 : "r" (uBit)); … … 128 128 static __inline__ void __atomic_add(__volatile__ unsigned *pu, const unsigned uAdd) 129 129 { 130 __asm__ __volatile__("lock addl %1, %0"130 __asm__ __volatile__("lock addl %1, %0" 131 131 : "=m" (*pu) 132 : "nr" (uAdd), 132 : "nr" (uAdd), 133 133 "m" (*pu)); 134 134 } … … 142 142 static __inline__ void __atomic_sub(__volatile__ unsigned *pu, const unsigned uSub) 143 143 { 144 __asm__ __volatile__("lock subl %1, %0"144 __asm__ __volatile__("lock subl %1, %0" 145 145 : "=m" (*pu) 146 : "nr" (uSub), 146 : "nr" (uSub), 147 147 "m" (*pu)); 148 148 } … … 156 156 static __inline__ void __atomic_increment(__volatile__ unsigned *pu) 157 157 { 158 __asm__ __volatile__("lock incl %0"159 : "=m" (*pu) 158 __asm__ __volatile__("lock incl %0" 159 : "=m" (*pu) 160 160 : "m" (*pu)); 161 161 } 162 162 163 163 /** 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 164 188 * Atomically decrements a 32-bit unsigned value. 165 189 * … … 168 192 static __inline__ void __atomic_decrement(__volatile__ unsigned *pu) 169 193 { 170 __asm__ __volatile__("lock decl %0"171 : "=m" (*pu) 194 __asm__ __volatile__("lock decl %0" 195 : "=m" (*pu) 172 196 : "m" (*pu)); 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 173 221 } 174 222 … … 192 240 "2:\n\t" 193 241 "incl %0\n\t" 194 "lock cmpxchgl %0, %1\n\t"242 "lock cmpxchgl %0, %1\n\t" 195 243 "jz 3f\n\t" 196 244 "jmp 1b\n" … … 228 276 "2:\n\t" 229 277 "incw %w0\n\t" 230 "lock cmpxchgw %w0, %2\n\t"278 "lock cmpxchgw %w0, %2\n\t" 231 279 "jz 3f\n\t" 232 280 "jmp 1b\n\t" … … 261 309 "2:\n\t" 262 310 "decl %0\n\t" 263 "lock cmpxchgl %0, %1\n\t"311 "lock cmpxchgl %0, %1\n\t" 264 312 "jz 3f\n\t" 265 313 "jmp 1b\n" … … 297 345 "2:\n\t" 298 346 "decw %%bx\n\t" 299 "lock cmpxchgw %w0, %1\n\t"347 "lock cmpxchgw %w0, %1\n\t" 300 348 "jz 3f\n\t" 301 349 "jmp 1b\n" … … 321 369 static inline unsigned __atomic_cmpxchg32(volatile uint32_t *pu32, uint32_t u32New, uint32_t u32Old) 322 370 { 323 __asm__ __volatile__("lock cmpxchgl %2, %1\n\t"371 __asm__ __volatile__("lock cmpxchgl %2, %1\n\t" 324 372 "setz %%al\n\t" 325 373 "movzx %%al, %%eax\n\t" -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
