Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79801
b: refs/heads/master
c: 6514f93
h: refs/heads/master
i:
  79799: 0fc58bf
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Jan 30, 2008
1 parent a9e3cfa commit c437d36
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 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: a33fff3a033f2e8a930067ad608c21e1f86bffab
refs/heads/master: 6514f93a2ce643ef5914eae7ce49b978e1d356aa
1 change: 0 additions & 1 deletion trunk/include/asm-x86/rwlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define _ASM_X86_RWLOCK_H

#define RW_LOCK_BIAS 0x01000000
#define RW_LOCK_BIAS_STR "0x01000000"

/* Actual code is in asm/spinlock.h or in arch/x86/lib/rwlock.S */

Expand Down
8 changes: 4 additions & 4 deletions trunk/include/asm-x86/spinlock_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ static inline void __raw_read_lock(raw_rwlock_t *rw)

static inline void __raw_write_lock(raw_rwlock_t *rw)
{
asm volatile(LOCK_PREFIX " subl $" RW_LOCK_BIAS_STR ",(%0)\n\t"
asm volatile(LOCK_PREFIX " subl %1,(%0)\n\t"
"jz 1f\n"
"call __write_lock_failed\n\t"
"1:\n"
::"a" (rw) : "memory");
::"a" (rw), "i" (RW_LOCK_BIAS) : "memory");
}

static inline int __raw_read_trylock(raw_rwlock_t *lock)
Expand Down Expand Up @@ -191,8 +191,8 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)

static inline void __raw_write_unlock(raw_rwlock_t *rw)
{
asm volatile(LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ", %0"
: "+m" (rw->lock) : : "memory");
asm volatile(LOCK_PREFIX "addl %1, %0"
: "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory");
}

#define _raw_spin_relax(lock) cpu_relax()
Expand Down
6 changes: 3 additions & 3 deletions trunk/include/asm-x86/spinlock_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static inline void __raw_read_lock(raw_rwlock_t *rw)
"jns 1f\n"
"call __read_lock_failed\n\t"
"1:\n"
::"D" (rw), "i" (RW_LOCK_BIAS) : "memory");
::"D" (rw) : "memory");
}

static inline void __raw_write_lock(raw_rwlock_t *rw)
Expand Down Expand Up @@ -167,8 +167,8 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)

static inline void __raw_write_unlock(raw_rwlock_t *rw)
{
asm volatile(LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ", %0"
: "+m" (rw->lock) : : "memory");
asm volatile(LOCK_PREFIX "addl %1, %0"
: "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory");
}

#define _raw_spin_relax(lock) cpu_relax()
Expand Down

0 comments on commit c437d36

Please sign in to comment.