diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-01-30 14:06:54 -0500 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-01-30 14:06:54 -0500 |
commit | 5d8b409c75e8994d8f57ae8fdf7179633b776f69 (patch) | |
tree | 10802ab6ffba531e2e3c2747d0b235594210d1d6 | |
parent | 79c047f2ac8a50f5ee3b1e98aa7a699c585072bb (diff) | |
download | rt-patches-5d8b409c75e8994d8f57ae8fdf7179633b776f69.tar.gz |
refresh rw_semaphores-Add-rw_anon_semaphores.patch
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | rw_semaphores-Add-rw_anon_semaphores.patch | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/rw_semaphores-Add-rw_anon_semaphores.patch b/rw_semaphores-Add-rw_anon_semaphores.patch index df436e3..8a4a774 100644 --- a/rw_semaphores-Add-rw_anon_semaphores.patch +++ b/rw_semaphores-Add-rw_anon_semaphores.patch @@ -1,4 +1,4 @@ -From 677b07c438616de0cc15206db4be1b3b16c92585 Mon Sep 17 00:00:00 2001 +From 6317c3b794e0e24a71a33a22033ea2cc17c07858 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 26 Jul 2009 15:35:40 +0200 Subject: [PATCH] rw_semaphores: Add rw_anon_semaphores @@ -1065,10 +1065,10 @@ index 6e56210..7a90aa2 100644 { return (sem->count != 0); diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h -index 4136200..8fca296 100644 +index 606ede1..0d686f7 100644 --- a/arch/x86/include/asm/rwsem.h +++ b/arch/x86/include/asm/rwsem.h -@@ -44,14 +44,14 @@ +@@ -45,14 +45,14 @@ struct rwsem_waiter; @@ -1091,16 +1091,16 @@ index 4136200..8fca296 100644 /* * the semaphore definition -@@ -64,7 +64,7 @@ extern asmregparm struct rw_semaphore * - #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS - #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) +@@ -76,7 +76,7 @@ extern asmregparm struct rw_semaphore * + + typedef signed long rwsem_count_t; -struct rw_semaphore { +struct rw_anon_semaphore { - signed long count; + rwsem_count_t count; spinlock_t wait_lock; struct list_head wait_list; -@@ -74,35 +74,34 @@ struct rw_semaphore { +@@ -86,35 +86,34 @@ struct rw_semaphore { }; #ifdef CONFIG_DEBUG_LOCK_ALLOC @@ -1145,17 +1145,17 @@ index 4136200..8fca296 100644 +static inline void __down_read(struct rw_anon_semaphore *sem) { asm volatile("# beginning down_read\n\t" - LOCK_PREFIX " inc%z0 (%1)\n\t" -@@ -119,7 +118,7 @@ static inline void __down_read(struct rw_semaphore *sem) + LOCK_PREFIX _ASM_INC "(%1)\n\t" +@@ -131,7 +130,7 @@ static inline void __down_read(struct rw_semaphore *sem) /* * trylock for reading -- returns 1 if successful, 0 if contention */ -static inline int __down_read_trylock(struct rw_semaphore *sem) +static inline int __down_read_trylock(struct rw_anon_semaphore *sem) { - __s32 result, tmp; + rwsem_count_t result, tmp; asm volatile("# beginning __down_read_trylock\n\t" -@@ -141,7 +140,8 @@ static inline int __down_read_trylock(struct rw_semaphore *sem) +@@ -153,7 +152,8 @@ static inline int __down_read_trylock(struct rw_semaphore *sem) /* * lock for writing */ @@ -1163,9 +1163,9 @@ index 4136200..8fca296 100644 +static inline void +__down_write_nested(struct rw_anon_semaphore *sem, int subclass) { - int tmp; + rwsem_count_t tmp; -@@ -160,7 +160,7 @@ static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) +@@ -172,7 +172,7 @@ static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) : "memory", "cc"); } @@ -1174,34 +1174,34 @@ index 4136200..8fca296 100644 { __down_write_nested(sem, 0); } -@@ -168,7 +168,7 @@ static inline void __down_write(struct rw_semaphore *sem) +@@ -180,7 +180,7 @@ static inline void __down_write(struct rw_semaphore *sem) /* * trylock for writing -- returns 1 if successful, 0 if contention */ -static inline int __down_write_trylock(struct rw_semaphore *sem) +static inline int __down_write_trylock(struct rw_anon_semaphore *sem) { - signed long ret = cmpxchg(&sem->count, - RWSEM_UNLOCKED_VALUE, -@@ -181,7 +181,7 @@ static inline int __down_write_trylock(struct rw_semaphore *sem) + rwsem_count_t ret = cmpxchg(&sem->count, + RWSEM_UNLOCKED_VALUE, +@@ -193,7 +193,7 @@ static inline int __down_write_trylock(struct rw_semaphore *sem) /* * unlock after reading */ -static inline void __up_read(struct rw_semaphore *sem) +static inline void __up_read(struct rw_anon_semaphore *sem) { - __s32 tmp = -RWSEM_ACTIVE_READ_BIAS; + rwsem_count_t tmp = -RWSEM_ACTIVE_READ_BIAS; asm volatile("# beginning __up_read\n\t" -@@ -199,7 +199,7 @@ static inline void __up_read(struct rw_semaphore *sem) +@@ -211,7 +211,7 @@ static inline void __up_read(struct rw_semaphore *sem) /* * unlock after writing */ -static inline void __up_write(struct rw_semaphore *sem) +static inline void __up_write(struct rw_anon_semaphore *sem) { - unsigned long tmp; + rwsem_count_t tmp; asm volatile("# beginning __up_write\n\t" -@@ -218,7 +218,7 @@ static inline void __up_write(struct rw_semaphore *sem) +@@ -230,7 +230,7 @@ static inline void __up_write(struct rw_semaphore *sem) /* * downgrade write lock to read lock */ @@ -1209,26 +1209,26 @@ index 4136200..8fca296 100644 +static inline void __downgrade_write(struct rw_anon_semaphore *sem) { asm volatile("# beginning __downgrade_write\n\t" - LOCK_PREFIX " add%z0 %2,(%1)\n\t" -@@ -235,7 +235,7 @@ static inline void __downgrade_write(struct rw_semaphore *sem) - /* + LOCK_PREFIX _ASM_ADD "%2,(%1)\n\t" +@@ -251,7 +251,7 @@ static inline void __downgrade_write(struct rw_semaphore *sem) * implement atomic add functionality */ --static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) -+static inline void rwsem_atomic_add(int delta, struct rw_anon_semaphore *sem) + static inline void rwsem_atomic_add(rwsem_count_t delta, +- struct rw_semaphore *sem) ++ struct rw_anon_semaphore *sem) { - asm volatile(LOCK_PREFIX "add%z0 %1,%0" + asm volatile(LOCK_PREFIX _ASM_ADD "%1,%0" : "+m" (sem->count) -@@ -245,7 +245,7 @@ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) - /* +@@ -262,7 +262,7 @@ static inline void rwsem_atomic_add(rwsem_count_t delta, * implement exchange and add functionality */ --static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) -+static inline int rwsem_atomic_update(int delta, struct rw_anon_semaphore *sem) + static inline rwsem_count_t rwsem_atomic_update(rwsem_count_t delta, +- struct rw_semaphore *sem) ++ struct rw_anon_semaphore *sem) { - int tmp = delta; + rwsem_count_t tmp = delta; -@@ -256,6 +256,47 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) +@@ -273,6 +273,47 @@ static inline rwsem_count_t rwsem_atomic_update(rwsem_count_t delta, return tmp + delta; } |