diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-20 01:16:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-20 01:16:58 -0500 |
commit | 497992917edf03994088ec8757b8262e1d9f568a (patch) | |
tree | 7e82975f98d3d3c9f80e10c981601db23eef5bd1 /include/asm-ia64/semaphore.h | |
parent | 7e732bfc5570b8f9bb5f155cf36e94b2e7d6bf6a (diff) | |
parent | 386d1d50c8eef254653b1015fde06622ef38ba76 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Diffstat (limited to 'include/asm-ia64/semaphore.h')
-rw-r--r-- | include/asm-ia64/semaphore.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/asm-ia64/semaphore.h b/include/asm-ia64/semaphore.h index bb8906285fab..f483eeb95dd1 100644 --- a/include/asm-ia64/semaphore.h +++ b/include/asm-ia64/semaphore.h | |||
@@ -61,7 +61,7 @@ static inline void | |||
61 | down (struct semaphore *sem) | 61 | down (struct semaphore *sem) |
62 | { | 62 | { |
63 | might_sleep(); | 63 | might_sleep(); |
64 | if (atomic_dec_return(&sem->count) < 0) | 64 | if (ia64_fetchadd(-1, &sem->count.counter, acq) < 1) |
65 | __down(sem); | 65 | __down(sem); |
66 | } | 66 | } |
67 | 67 | ||
@@ -75,7 +75,7 @@ down_interruptible (struct semaphore * sem) | |||
75 | int ret = 0; | 75 | int ret = 0; |
76 | 76 | ||
77 | might_sleep(); | 77 | might_sleep(); |
78 | if (atomic_dec_return(&sem->count) < 0) | 78 | if (ia64_fetchadd(-1, &sem->count.counter, acq) < 1) |
79 | ret = __down_interruptible(sem); | 79 | ret = __down_interruptible(sem); |
80 | return ret; | 80 | return ret; |
81 | } | 81 | } |
@@ -85,7 +85,7 @@ down_trylock (struct semaphore *sem) | |||
85 | { | 85 | { |
86 | int ret = 0; | 86 | int ret = 0; |
87 | 87 | ||
88 | if (atomic_dec_return(&sem->count) < 0) | 88 | if (ia64_fetchadd(-1, &sem->count.counter, acq) < 1) |
89 | ret = __down_trylock(sem); | 89 | ret = __down_trylock(sem); |
90 | return ret; | 90 | return ret; |
91 | } | 91 | } |
@@ -93,7 +93,7 @@ down_trylock (struct semaphore *sem) | |||
93 | static inline void | 93 | static inline void |
94 | up (struct semaphore * sem) | 94 | up (struct semaphore * sem) |
95 | { | 95 | { |
96 | if (atomic_inc_return(&sem->count) <= 0) | 96 | if (ia64_fetchadd(1, &sem->count.counter, rel) <= -1) |
97 | __up(sem); | 97 | __up(sem); |
98 | } | 98 | } |
99 | 99 | ||