1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00
freebsd-ports/deskutils/lightning/files/patch-mozilla-js-src-jslock.cpp
Beat Gaetzi db20b8b870 - Add Lightning 1.0 Beta 1. This version works with Thunderbird 3.0 and
SeaMonkey 2.0.

Lightning brings the Sunbird calendar to the popular email client, Mozilla
Thunderbird and the SeaMonkey internet application suite. Since it's an
extension, Lightning is tightly integrated with Thunderbird or SeaMonkey,
allowing it to easily perform email-related calendaring tasks.

WWW:    http://www.mozilla.org/projects/calendar/lightning/

Thanks to:      Andreas Tobler <andreast-list AT fgznet.ch>
2010-08-03 20:35:04 +00:00

38 lines
1.1 KiB
C++

--- mozilla/js/src/jslock.cpp.orig 2010-01-23 15:40:12.000000000 +0100
+++ mozilla/js/src/jslock.cpp 2010-01-23 15:45:20.000000000 +0100
@@ -133,7 +133,7 @@
return (int)res;
}
-#elif defined(SOLARIS) && defined(sparc) && defined(ULTRA_SPARC)
+#elif defined(__sparc)
static JS_ALWAYS_INLINE int
NativeCompareAndSwap(jsword *w, jsword ov, jsword nv)
@@ -142,13 +142,18 @@
unsigned int res;
JS_ASSERT(ov != nv);
asm volatile ("\
-stbar\n\
-cas [%1],%2,%3\n\
-cmp %2,%3\n\
-be,a 1f\n\
-mov 1,%0\n\
-mov 0,%0\n\
-1:"
+ membar #StoreLoad | #LoadLoad\n"
+# if defined (__sparc64__)
+ "casx [%1],%2,%3\n"
+# else
+ "cas [%1],%2,%3\n" /* 32-bit version */
+# endif
+ "membar #StoreLoad | #LoadLoad\n"
+ "cmp %2,%3\n"
+ "be,a 1f\n"
+ "mov 1,%0\n"
+ "mov 0,%0\n"
+ "1:"
: "=r" (res)
: "r" (w), "r" (ov), "r" (nv));
return (int)res;