diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2006-09-28 10:56:43 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2006-09-28 10:56:43 -0400 |
commit | 94c12cc7d196bab34aaa98d38521549fa1e5ef76 (patch) | |
tree | 8e0cec0ed44445d74a2cb5160303d6b4dfb1bc31 /include/asm-s390/semaphore.h | |
parent | 25d83cbfaa44e1b9170c0941c3ef52ca39f54ccc (diff) |
[S390] Inline assembly cleanup.
Major cleanup of all s390 inline assemblies. They now have a common
coding style. Quite a few have been shortened, mainly by using register
asm variables. Use of the EX_TABLE macro helps as well. The atomic ops,
bit ops and locking inlines new use the Q-constraint if a newer gcc
is used. That results in slightly better code.
Thanks to Christian Borntraeger for proof reading the changes.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'include/asm-s390/semaphore.h')
-rw-r--r-- | include/asm-s390/semaphore.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/asm-s390/semaphore.h b/include/asm-s390/semaphore.h index 32cdc69f39f4..dbce058aefa9 100644 --- a/include/asm-s390/semaphore.h +++ b/include/asm-s390/semaphore.h | |||
@@ -85,17 +85,17 @@ static inline int down_trylock(struct semaphore * sem) | |||
85 | * sem->count.counter = --new_val; | 85 | * sem->count.counter = --new_val; |
86 | * In the ppc code this is called atomic_dec_if_positive. | 86 | * In the ppc code this is called atomic_dec_if_positive. |
87 | */ | 87 | */ |
88 | __asm__ __volatile__ ( | 88 | asm volatile( |
89 | " l %0,0(%3)\n" | 89 | " l %0,0(%3)\n" |
90 | "0: ltr %1,%0\n" | 90 | "0: ltr %1,%0\n" |
91 | " jle 1f\n" | 91 | " jle 1f\n" |
92 | " ahi %1,-1\n" | 92 | " ahi %1,-1\n" |
93 | " cs %0,%1,0(%3)\n" | 93 | " cs %0,%1,0(%3)\n" |
94 | " jl 0b\n" | 94 | " jl 0b\n" |
95 | "1:" | 95 | "1:" |
96 | : "=&d" (old_val), "=&d" (new_val), "=m" (sem->count.counter) | 96 | : "=&d" (old_val), "=&d" (new_val), "=m" (sem->count.counter) |
97 | : "a" (&sem->count.counter), "m" (sem->count.counter) | 97 | : "a" (&sem->count.counter), "m" (sem->count.counter) |
98 | : "cc", "memory" ); | 98 | : "cc", "memory"); |
99 | return old_val <= 0; | 99 | return old_val <= 0; |
100 | } | 100 | } |
101 | 101 | ||