(*addr) = RW_LOCK_BIAS;
}
-
-inline void readLock(volatile unsigned int *addr) {
- __asm__ __volatile__ ("" " subl $1,(%0)\n\t"
- "jns 1f\n"
- "1:\n"
- :: "a" (*addr) : "memory");
-}
-
-inline void writeLock(volatile unsigned int *addr) {
- __asm__ __volatile__ ("" " subl %1,(%0)\n\t"
- "jz 1f\n"
- "1:\n"
- :: "a" (*addr), "i" (RW_LOCK_BIAS) : "memory");
-}
-
inline void atomic_dec(volatile unsigned int *v) {
__asm__ __volatile__ (LOCK_PREFIX "decl %0"
: "+m" (*v));
} atomic_t;
void initdsmlocks(volatile unsigned int *addr);
-void readLock(volatile unsigned int *addr);
-void writeLock(volatile unsigned int *addr);
int read_trylock(volatile unsigned int *lock);
int write_trylock(volatile unsigned int *lock);
void atomic_dec(volatile unsigned int *v);