Fixing Tegra2 build
[tpg/acess2.git] / Kernel / arch / armv7 / include / lock.h
index 627726b..6688af4 100644 (file)
@@ -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"
                        );

UCC git Repository :: git.ucc.asn.au