summaryrefslogtreecommitdiff
path: root/mail/thunderbird/patches/patch-bb
blob: c9e715ad465b5db26212922d584ca790916408c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$NetBSD: patch-bb,v 1.7 2010/07/12 16:49:22 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

--- mozilla/js/src/jslock.cpp.orig	2010-02-27 02:32:31.000000000 +0000
+++ mozilla/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;
 }