vserver 2.0 rc7
[linux-2.6.git] / include / asm-sparc64 / rwsem.h
index 82fffac..bf2ae90 100644 (file)
 
 #include <linux/list.h>
 #include <linux/spinlock.h>
+#include <asm/rwsem-const.h>
 
 struct rwsem_waiter;
 
 struct rw_semaphore {
        signed int count;
-#define RWSEM_UNLOCKED_VALUE           0x00000000
-#define RWSEM_ACTIVE_BIAS              0x00000001
-#define RWSEM_ACTIVE_MASK              0x0000ffff
-#define RWSEM_WAITING_BIAS             0xffff0000
-#define RWSEM_ACTIVE_READ_BIAS         RWSEM_ACTIVE_BIAS
-#define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
        spinlock_t              wait_lock;
        struct list_head        wait_list;
 };
@@ -56,16 +51,16 @@ static __inline__ int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
        int tmp = delta;
 
        __asm__ __volatile__(
-               "1:\tlduw       [%2], %%g5\n\t"
-               "add            %%g5, %1, %%g7\n\t"
-               "cas            [%2], %%g5, %%g7\n\t"
-               "cmp            %%g5, %%g7\n\t"
+               "1:\tlduw       [%2], %%g1\n\t"
+               "add            %%g1, %1, %%g7\n\t"
+               "cas            [%2], %%g1, %%g7\n\t"
+               "cmp            %%g1, %%g7\n\t"
                "bne,pn         %%icc, 1b\n\t"
                " membar        #StoreLoad | #StoreStore\n\t"
                "mov            %%g7, %0\n\t"
                : "=&r" (tmp)
                : "0" (tmp), "r" (sem)
-               : "g5", "g7", "memory", "cc");
+               : "g1", "g7", "memory", "cc");
 
        return tmp + delta;
 }