Skip to content
Snippets Groups Projects
Commit 7ec592a6 authored by John Hodge's avatar John Hodge
Browse files

Kernel/arm7 - Fixed SPINLOCK to use the swap opcode

parent 263e8355
Branches
Tags
No related merge requests found
......@@ -28,12 +28,16 @@ static inline int SHORTLOCK(struct sShortSpinlock *Lock)
{
#if 0
while( __sync_lock_test_and_set( &Lock->Lock, 1 ) == 1 );
#endif
#if 1
#elif 0
while( Lock->Lock ) ;
Lock->Lock = 1;
#endif
#if 0
#elif 1
int v = 1;
while( v )
{
__asm__ __volatile__ ("swp [%0], %1" : "=r" (v) : "r" (&lock));
}
#elif 0
// Shamelessly copied from linux (/arch/arm/include/asm/spinlock.h) until I can fix stuff
Uint tmp;
__asm__ __volatile__ (
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment