git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel/arm7 - Serial works (realview-pb-a8)
[tpg/acess2.git]
/
Kernel
/
arch
/
arm7
/
include
/
lock.h
diff --git
a/Kernel/arch/arm7/include/lock.h
b/Kernel/arch/arm7/include/lock.h
index
5a67086
..
627726b
100644
(file)
--- a/
Kernel/arch/arm7/include/lock.h
+++ b/
Kernel/arch/arm7/include/lock.h
@@
-26,6
+26,7
@@
static inline int CPU_HAS_LOCK(struct sShortSpinlock *Lock)
static inline int SHORTLOCK(struct sShortSpinlock *Lock)
{
static inline int SHORTLOCK(struct sShortSpinlock *Lock)
{
+ #if 1
// Coped from linux, yes, but I know what it does now :)
Uint tmp;
__asm__ __volatile__ (
// Coped from linux, yes, but I know what it does now :)
Uint tmp;
__asm__ __volatile__ (
@@
-38,6
+39,15
@@
static inline int SHORTLOCK(struct sShortSpinlock *Lock)
: "r" (&Lock->Lock), "r" (1)
: "cc" // Condition codes clobbered
);
: "r" (&Lock->Lock), "r" (1)
: "cc" // Condition codes clobbered
);
+ #else
+ int v = 1;
+ while( v )
+ __asm__ __volatile__ (
+ "swp %0, [%1]"
+ : "=r" (v) : "r" (&Lock->Lock)
+ : "cc"
+ );
+ #endif
return 1;
}
return 1;
}
UCC
git Repository :: git.ucc.asn.au