Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37635
b: refs/heads/master
c: ef6edc9
h: refs/heads/master
i:
  37633: 1d855f6
  37631: 072cd78
v: v3
  • Loading branch information
Martin Schwidefsky authored and Linus Torvalds committed Oct 1, 2006
1 parent d8e216d commit aaeb2c4
Show file tree
Hide file tree
Showing 17 changed files with 63 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: e3e5fc91d9828a9b94a3992de47d47d2d2e34ec6
refs/heads/master: ef6edc9746dc2bfdacf44eefd5f881179971c478
4 changes: 4 additions & 0 deletions trunk/include/asm-alpha/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,8 @@ static inline void __raw_write_unlock(raw_rwlock_t * lock)
lock->lock = 0;
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* _ALPHA_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-arm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,8 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
/* read_can_lock - would read_trylock() succeed? */
#define __raw_read_can_lock(x) ((x)->lock < 0x80000000)

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* __ASM_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-cris/arch-v32/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,8 @@ static __inline__ int is_write_locked(rwlock_t *rw)
return rw->counter < 0;
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* __ASM_ARCH_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-i386/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
: "+m" (rw->lock) : : "memory");
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* __ASM_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-ia64/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,8 @@ static inline int __raw_read_trylock(raw_rwlock_t *x)
return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word;
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* _ASM_IA64_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-m32r/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock)
return 0;
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* _ASM_M32R_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-mips/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
}


#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* _ASM_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-parisc/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,8 @@ static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw)
return !rw->counter;
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* __ASM_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-powerpc/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,9 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw)
rw->lock = 0;
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* __KERNEL__ */
#endif /* __ASM_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-ppc/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,8 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw)
rw->lock = 0;
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* __ASM_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-s390/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
return _raw_write_trylock_retry(rw);
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* __ASM_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-sh/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
return 0;
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* __ASM_SH_SPINLOCK_H */
4 changes: 4 additions & 0 deletions trunk/include/asm-sparc/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#define __raw_read_can_lock(rw) (!((rw)->lock & 0xff))
#define __raw_write_can_lock(rw) (!(rw)->lock)

Expand Down
4 changes: 4 additions & 0 deletions trunk/include/asm-sparc64/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ static int inline __write_trylock(raw_rwlock_t *lock)
#define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL))
#define __raw_write_can_lock(rw) (!(rw)->lock)

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* !(__ASSEMBLY__) */

#endif /* !(__SPARC64_SPINLOCK_H) */
4 changes: 4 additions & 0 deletions trunk/include/asm-x86_64/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
: "=m" (rw->lock) : : "memory");
}

#define _raw_spin_relax(lock) cpu_relax()
#define _raw_read_relax(lock) cpu_relax()
#define _raw_write_relax(lock) cpu_relax()

#endif /* __ASM_SPINLOCK_H */
4 changes: 2 additions & 2 deletions trunk/kernel/spinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void __lockfunc _##op##_lock(locktype##_t *lock) \
if (!(lock)->break_lock) \
(lock)->break_lock = 1; \
while (!op##_can_lock(lock) && (lock)->break_lock) \
cpu_relax(); \
_raw_##op##_relax(&lock->raw_lock); \
} \
(lock)->break_lock = 0; \
} \
Expand All @@ -237,7 +237,7 @@ unsigned long __lockfunc _##op##_lock_irqsave(locktype##_t *lock) \
if (!(lock)->break_lock) \
(lock)->break_lock = 1; \
while (!op##_can_lock(lock) && (lock)->break_lock) \
cpu_relax(); \
_raw_##op##_relax(&lock->raw_lock); \
} \
(lock)->break_lock = 0; \
return flags; \
Expand Down

0 comments on commit aaeb2c4

Please sign in to comment.