X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Farm7%2Finclude%2Flock.h;h=627726b568f7f009125e6d697616016f2bd6ecd6;hb=3733a77bb073c6c22e674bebe22a6f4f9a2b5225;hp=5a6708623bf4af36aeca3c1ae2e076376e4a7647;hpb=5473eb360038564028bd9afa0193f5841ab628cd;p=tpg%2Facess2.git diff --git a/Kernel/arch/arm7/include/lock.h b/Kernel/arch/arm7/include/lock.h index 5a670862..627726b5 100644 --- 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) { + #if 1 // 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 ); + #else + int v = 1; + while( v ) + __asm__ __volatile__ ( + "swp %0, [%1]" + : "=r" (v) : "r" (&Lock->Lock) + : "cc" + ); + #endif return 1; }