projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
powerpc: Use lwarx hint in spinlocks
[firefly-linux-kernel-4.4.55.git]
/
arch
/
powerpc
/
include
/
asm
/
spinlock.h
diff --git
a/arch/powerpc/include/asm/spinlock.h
b/arch/powerpc/include/asm/spinlock.h
index 764094cff68172609db5ce6d4e05a1a2b8229598..1c35b59f6f30c0f528e6538483f764a30218d761 100644
(file)
--- a/
arch/powerpc/include/asm/spinlock.h
+++ b/
arch/powerpc/include/asm/spinlock.h
@@
-27,6
+27,7
@@
#endif
#include <asm/asm-compat.h>
#include <asm/synch.h>
#endif
#include <asm/asm-compat.h>
#include <asm/synch.h>
+#include <asm/ppc-opcode.h>
#define arch_spin_is_locked(x) ((x)->slock != 0)
#define arch_spin_is_locked(x) ((x)->slock != 0)
@@
-60,7
+61,7
@@
static inline unsigned long __arch_spin_trylock(arch_spinlock_t *lock)
token = LOCK_TOKEN;
__asm__ __volatile__(
token = LOCK_TOKEN;
__asm__ __volatile__(
-"1:
lwarx %0,0,%2
\n\
+"1:
" PPC_LWARX(%0,0,%2,1) "
\n\
cmpwi 0,%0,0\n\
bne- 2f\n\
stwcx. %1,0,%2\n\
cmpwi 0,%0,0\n\
bne- 2f\n\
stwcx. %1,0,%2\n\
@@
-186,7
+187,7
@@
static inline long __arch_read_trylock(arch_rwlock_t *rw)
long tmp;
__asm__ __volatile__(
long tmp;
__asm__ __volatile__(
-"1:
lwarx %0,0,%1
\n"
+"1:
" PPC_LWARX(%0,0,%1,1) "
\n"
__DO_SIGN_EXTEND
" addic. %0,%0,1\n\
ble- 2f\n"
__DO_SIGN_EXTEND
" addic. %0,%0,1\n\
ble- 2f\n"
@@
-211,7
+212,7
@@
static inline long __arch_write_trylock(arch_rwlock_t *rw)
token = WRLOCK_TOKEN;
__asm__ __volatile__(
token = WRLOCK_TOKEN;
__asm__ __volatile__(
-"1:
lwarx %0,0,%2
\n\
+"1:
" PPC_LWARX(%0,0,%2,1) "
\n\
cmpwi 0,%0,0\n\
bne- 2f\n"
PPC405_ERR77(0,%1)
cmpwi 0,%0,0\n\
bne- 2f\n"
PPC405_ERR77(0,%1)