ff57234978
work for some users (sparc64 support, for example, is busted and won't appear again until firefox-5.0).
35 lines
1 KiB
Text
35 lines
1 KiB
Text
$NetBSD: patch-bb,v 1.1.1.1 2011/04/19 11:16:08 tnn Exp $
|
|
|
|
# make sure the inline assembler code works on the same word size as
|
|
# the C/C++ code on sparc64 when compiling for 64bit
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=550271
|
|
|
|
--- js/src/jslock.cpp.orig 2010-02-27 02:32:31.000000000 +0000
|
|
+++ js/src/jslock.cpp
|
|
@@ -159,6 +159,7 @@ NativeCompareAndSwap(jsword *w, jsword o
|
|
{
|
|
unsigned int res;
|
|
|
|
+#if JS_BITS_PER_WORD == 32
|
|
__asm__ __volatile__ (
|
|
"stbar\n"
|
|
"cas [%1],%2,%3\n"
|
|
@@ -169,6 +170,18 @@ NativeCompareAndSwap(jsword *w, jsword o
|
|
"1:"
|
|
: "=r" (res)
|
|
: "r" (w), "r" (ov), "r" (nv));
|
|
+#else
|
|
+ __asm__ __volatile__ (
|
|
+ "stbar\n"
|
|
+ "casx [%1],%2,%3\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));
|
|
+#endif
|
|
return (int)res;
|
|
}
|
|
|