X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Farmv7%2Finclude%2Flock.h;fp=Kernel%2Farch%2Farmv7%2Finclude%2Flock.h;h=6688af48a8dc2084be3538c813fc97b8a2614e5b;hb=72e1657f992d917aee5c0b5ca17bf730537629d1;hp=627726b568f7f009125e6d697616016f2bd6ecd6;hpb=1501fe53f7cc9d2d7bcb30abac636a8afbee2f8b;p=tpg%2Facess2.git diff --git a/Kernel/arch/armv7/include/lock.h b/Kernel/arch/armv7/include/lock.h index 627726b5..6688af48 100644 --- a/Kernel/arch/armv7/include/lock.h +++ b/Kernel/arch/armv7/include/lock.h @@ -26,7 +26,7 @@ static inline int CPU_HAS_LOCK(struct sShortSpinlock *Lock) static inline int SHORTLOCK(struct sShortSpinlock *Lock) { - #if 1 + #if 0 // Coped from linux, yes, but I know what it does now :) Uint tmp; __asm__ __volatile__ ( @@ -39,11 +39,14 @@ static inline int SHORTLOCK(struct sShortSpinlock *Lock) : "r" (&Lock->Lock), "r" (1) : "cc" // Condition codes clobbered ); + #elif 1 + while( *(volatile int*)&Lock->Lock ) ; + Lock->Lock = 1; #else int v = 1; while( v ) __asm__ __volatile__ ( - "swp %0, [%1]" + "swp %0, %0, [%1]" : "=r" (v) : "r" (&Lock->Lock) : "cc" );