git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
include
/
asm-i386
/
spinlock.h
diff --git
a/include/asm-i386/spinlock.h
b/include/asm-i386/spinlock.h
index
6d794a3
..
2360435
100644
(file)
--- a/
include/asm-i386/spinlock.h
+++ b/
include/asm-i386/spinlock.h
@@
-35,41
+35,31
@@
#define __raw_spin_lock_string_flags \
"\n1:\t" \
"lock ; decb %0\n\t" \
#define __raw_spin_lock_string_flags \
"\n1:\t" \
"lock ; decb %0\n\t" \
- "jns
5f\n
" \
- "2:\t"
\
+ "jns
4f\n\t
" \
+ "2:\t" \
"testl $0x200, %1\n\t" \
"testl $0x200, %1\n\t" \
- "jz
4
f\n\t" \
- "sti\n" \
+ "jz
3
f\n\t" \
+ "sti\n
\t
" \
"3:\t" \
"rep;nop\n\t" \
"cmpb $0, %0\n\t" \
"jle 3b\n\t" \
"cli\n\t" \
"jmp 1b\n" \
"3:\t" \
"rep;nop\n\t" \
"cmpb $0, %0\n\t" \
"jle 3b\n\t" \
"cli\n\t" \
"jmp 1b\n" \
- "4:\t" \
- "rep;nop\n\t" \
- "cmpb $0, %0\n\t" \
- "jg 1b\n\t" \
- "jmp 4b\n" \
- "5:\n\t"
-
-#define __raw_spin_lock_string_up \
- "\n\tdecb %0"
+ "4:\n\t"
static inline void __raw_spin_lock(raw_spinlock_t *lock)
{
static inline void __raw_spin_lock(raw_spinlock_t *lock)
{
- alternative_smp(
- __raw_spin_lock_string,
- __raw_spin_lock_string_up,
- "=m" (lock->slock) : : "memory");
+ __asm__ __volatile__(
+ __raw_spin_lock_string
+ :"=m" (lock->slock) : : "memory");
}
static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
{
}
static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
{
- alternative_smp(
- __raw_spin_lock_string_flags,
- __raw_spin_lock_string_up,
- "=m" (lock->slock) : "r" (flags) : "memory");
+ __asm__ __volatile__(
+ __raw_spin_lock_string_flags
+ :"=m" (lock->slock) : "r" (flags) : "memory");
}
static inline int __raw_spin_trylock(raw_spinlock_t *lock)
}
static inline int __raw_spin_trylock(raw_spinlock_t *lock)
@@
-188,12
+178,12
@@
static inline int __raw_write_trylock(raw_rwlock_t *lock)
static inline void __raw_read_unlock(raw_rwlock_t *rw)
{
static inline void __raw_read_unlock(raw_rwlock_t *rw)
{
- asm volatile(
LOCK_PREFIX "
incl %0" :"=m" (rw->lock) : : "memory");
+ asm volatile(
"lock ;
incl %0" :"=m" (rw->lock) : : "memory");
}
static inline void __raw_write_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"
+ asm volatile(
"lock ;
addl $" RW_LOCK_BIAS_STR ", %0"
: "=m" (rw->lock) : : "memory");
}
: "=m" (rw->lock) : : "memory");
}