Get the MIPS assembler syntax right. Also add a separate sync command;
authorTom Lane <[email protected]>
Sat, 27 Aug 2005 16:22:58 +0000 (16:22 +0000)
committerTom Lane <[email protected]>
Sat, 27 Aug 2005 16:22:58 +0000 (16:22 +0000)
the reference I consulted yesterday said SC does a SYNC, but apparently
this is not true on newer MIPS processors, so be safe.

src/include/storage/s_lock.h

index 0e416056bd4355c9f62df826aa6845346cf6ad44..c7479c46a4df44b8a336a6038317bdfaa919c179 100644 (file)
@@ -440,6 +440,7 @@ do \
 
 #if defined(__mips__) && !defined(__sgi)
 /* Note: on SGI we use the OS' mutex ABI, see below */
+/* Note: R10000 processors require a separate SYNC */
 #define HAS_TEST_AND_SET
 
 typedef unsigned int slock_t;
@@ -459,11 +460,12 @@ tas(volatile slock_t *lock)
                "       .set noreorder      \n"
                "       .set nomacro        \n"
                "       ll      %0, %2      \n"
-               "       or      %1, %0, $1  \n"
+               "       or      %1, %0,   \n"
                "       sc      %1, %2      \n"
-               "       xori    %1, $1      \n"
+               "       xori    %1,       \n"
                "       or      %0, %0, %1  \n"
-               "1:     .set pop              "
+               "       sync                \n"
+               "       .set pop              "
 :              "=&r" (_res), "=&r" (_tmp), "+R" (*_l)
 :
 :              "memory");