Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20959
b: refs/heads/master
c: 9656716
h: refs/heads/master
i:
  20957: 96a90ea
  20955: da415c3
  20951: 11b4bad
  20943: 5059052
  20927: ca77ac6
v: v3
  • Loading branch information
Christian Ehrhardt authored and Linus Torvalds committed Mar 10, 2006
1 parent 49d9beb commit 5017ca3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a88231fc7da311e4da4ce2011d1a132c80c145a
refs/heads/master: 96567161de0ceed45cd2eb0e5380e3c797f5c0f4
15 changes: 13 additions & 2 deletions trunk/arch/s390/lib/spinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* arch/s390/lib/spinlock.c
* Out of line spinlock code.
*
* S390 version
* Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Copyright (C) IBM Corp. 2004, 2006
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
*/

Expand Down Expand Up @@ -44,6 +43,8 @@ _raw_spin_lock_wait(raw_spinlock_t *lp, unsigned int pc)
_diag44();
count = spin_retry;
}
if (__raw_spin_is_locked(lp))
continue;
if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
return;
}
Expand All @@ -56,6 +57,8 @@ _raw_spin_trylock_retry(raw_spinlock_t *lp, unsigned int pc)
int count = spin_retry;

while (count-- > 0) {
if (__raw_spin_is_locked(lp))
continue;
if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
return 1;
}
Expand All @@ -74,6 +77,8 @@ _raw_read_lock_wait(raw_rwlock_t *rw)
_diag44();
count = spin_retry;
}
if (!__raw_read_can_lock(rw))
continue;
old = rw->lock & 0x7fffffffU;
if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
return;
Expand All @@ -88,6 +93,8 @@ _raw_read_trylock_retry(raw_rwlock_t *rw)
int count = spin_retry;

while (count-- > 0) {
if (!__raw_read_can_lock(rw))
continue;
old = rw->lock & 0x7fffffffU;
if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
return 1;
Expand All @@ -106,6 +113,8 @@ _raw_write_lock_wait(raw_rwlock_t *rw)
_diag44();
count = spin_retry;
}
if (!__raw_write_can_lock(rw))
continue;
if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
return;
}
Expand All @@ -118,6 +127,8 @@ _raw_write_trylock_retry(raw_rwlock_t *rw)
int count = spin_retry;

while (count-- > 0) {
if (!__raw_write_can_lock(rw))
continue;
if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
return 1;
}
Expand Down

0 comments on commit 5017ca3

Please sign in to comment.