X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Farm7%2Finclude%2Flock.h;h=e270145c16c105983f5860dceddea971882ef5ed;hb=818dd00ebd8c60ea2d47a01a26381b4adc087bdb;hp=9b289d137fd859f1f34155bc37d8278581dc68bc;hpb=28eafc7611ec3d3f840845ec2b54025affd7bc1e;p=tpg%2Facess2.git diff --git a/Kernel/arch/arm7/include/lock.h b/Kernel/arch/arm7/include/lock.h index 9b289d13..e270145c 100644 --- a/Kernel/arch/arm7/include/lock.h +++ b/Kernel/arch/arm7/include/lock.h @@ -26,6 +26,14 @@ static inline int CPU_HAS_LOCK(struct sShortSpinlock *Lock) static inline int SHORTLOCK(struct sShortSpinlock *Lock) { + #if 0 + while( __sync_lock_test_and_set( &Lock->Lock, 1 ) == 1 ); + #endif + #if 1 + while( Lock->Lock ) ; + Lock->Lock = 1; + #endif + #if 0 // Shamelessly copied from linux (/arch/arm/include/asm/spinlock.h) until I can fix stuff Uint tmp; __asm__ __volatile__ ( @@ -38,6 +46,7 @@ static inline int SHORTLOCK(struct sShortSpinlock *Lock) : "r" (&Lock->Lock), "r" (1) : "cc" // Condition codes clobbered ); + #endif return 1; }