Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14200
b: refs/heads/master
c: 485832a
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Nov 15, 2005
1 parent 330c620 commit 30c3820
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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: 8315eca25583c369e28f48909d3341dc21d6214d
refs/heads/master: 485832a5d928facd82f1525270d9f048da2063a1
12 changes: 6 additions & 6 deletions trunk/include/asm-x86_64/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@
*/

#define __raw_spin_is_locked(x) \
(*(volatile signed char *)(&(x)->slock) <= 0)
(*(volatile signed int *)(&(x)->slock) <= 0)

#define __raw_spin_lock_string \
"\n1:\t" \
"lock ; decb %0\n\t" \
"lock ; decl %0\n\t" \
"js 2f\n" \
LOCK_SECTION_START("") \
"2:\t" \
"rep;nop\n\t" \
"cmpb $0,%0\n\t" \
"cmpl $0,%0\n\t" \
"jle 2b\n\t" \
"jmp 1b\n" \
LOCK_SECTION_END

#define __raw_spin_unlock_string \
"movb $1,%0" \
"movl $1,%0" \
:"=m" (lock->slock) : : "memory"

static inline void __raw_spin_lock(raw_spinlock_t *lock)
Expand All @@ -47,10 +47,10 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)

static inline int __raw_spin_trylock(raw_spinlock_t *lock)
{
char oldval;
int oldval;

__asm__ __volatile__(
"xchgb %b0,%1"
"xchgl %0,%1"
:"=q" (oldval), "=m" (lock->slock)
:"0" (0) : "memory");

Expand Down

0 comments on commit 30c3820

Please sign in to comment.