[xulrunner] Fixed s390x patch by Martin Stransky

Jan Horak xhorak at fedoraproject.org
Fri Dec 2 15:12:37 UTC 2011


commit d75019a09944bdd19b7a2f1d85c5756860c5835a
Author: Jan Horak <jhorak at redhat.com>
Date:   Fri Dec 2 16:12:31 2011 +0100

    Fixed s390x patch by Martin Stransky

 mozilla-696393.patch |   78 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 76 insertions(+), 2 deletions(-)
---
diff --git a/mozilla-696393.patch b/mozilla-696393.patch
index aed422c..66614ac 100644
--- a/mozilla-696393.patch
+++ b/mozilla-696393.patch
@@ -1,6 +1,6 @@
 diff -up mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp.696393 mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp
---- mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp.696393	2011-11-04 22:34:23.000000000 +0100
-+++ mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp	2011-11-29 15:25:31.016899861 +0100
+--- mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp.696393	2011-11-04 17:34:23.000000000 -0400
++++ mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp	2011-12-01 12:25:09.947558444 -0500
 @@ -200,56 +200,22 @@ invoke_copy_to_stack(PRUint32 paramCount
      }
  }
@@ -69,3 +69,77 @@ diff -up mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390
 +    return method(that, d_gpr[0], d_gpr[1], d_gpr[2], d_gpr[3],  d_fpr[0], d_fpr[1]);
  }
  
+diff -up mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp.696393 mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp
+--- mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp.696393	2011-11-04 17:34:23.000000000 -0400
++++ mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp	2011-12-02 09:33:06.717556519 -0500
+@@ -194,59 +194,23 @@ invoke_copy_to_stack(PRUint32 paramCount
+     }
+ }
+ 
++typedef nsresult (*vtable_func)(nsISupports *, PRUint64, PRUint64, PRUint64, PRUint64, double, double, double, double);
++
+ EXPORT_XPCOM_API(nsresult)
+ NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
+                  PRUint32 paramCount, nsXPTCVariant* params)
+ {
+-    PRUint64 *vtable = *(PRUint64 **)that;
+-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
+-    PRUint64 method = vtable[methodIndex];
+-#else /* not G++ V3 ABI  */
+-    PRUint64 method = vtable[methodIndex + 2];
+-#endif /* G++ V3 ABI */
++    vtable_func *vtable = *reinterpret_cast<vtable_func **>(that);
++    vtable_func method = vtable[methodIndex];
+     PRUint64 overflow = invoke_count_words (paramCount, params);
++    PRUint64 *stack_space = reinterpret_cast<PRUint64 *>(__builtin_alloca((overflow + 8 /* 4 64-bits gpr + 4 64-bits fpr */) * 8));
+     PRUint64 result;
+ 
+-    __asm__ __volatile__
+-    (
+-        "lgr    7,15\n\t"
+-        "aghi   7,-64\n\t"
+-
+-        "lgr    3,%3\n\t"
+-        "sllg   3,3,3\n\t"
+-        "lcgr   3,3\n\t"
+-        "lg     2,0(15)\n\t"
+-        "la     15,0(3,7)\n\t"
+-        "stg    2,0(15)\n\t"
+-
+-        "lgr    2,%1\n\t"
+-        "lgr    3,%2\n\t"
+-        "la     4,160(15)\n\t"
+-        "lgr    5,%3\n\t"
+-        "basr   14,%4\n\t"
+-
+-        "lgr    2,%5\n\t"
+-        "ld     0,192(7)\n\t"
+-        "ld     2,200(7)\n\t"
+-        "ld     4,208(7)\n\t"
+-        "ld     6,216(7)\n\t"
+-        "lmg    3,6,160(7)\n\t"
+-        "basr   14,%6\n\t"
+-
+-        "la     15,64(7)\n\t"
+-
+-        "lgr    %0,2\n\t"
+-        : "=r" (result)
+-        : "r" ((PRUint64)paramCount),
+-          "r" (params),
+-          "r" (overflow),
+-          "a" (invoke_copy_to_stack),
+-          "a" (that),
+-          "a" (method)
+-        : "2", "3", "4", "5", "6", "7", "14", "cc", "memory",
+-	  "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7"
+-    );
+-  
+-    return result;
++    invoke_copy_to_stack(paramCount, params, stack_space, overflow);
++
++    PRUint64 *d_gpr = stack_space + overflow;
++    double *d_fpr = reinterpret_cast<double *>(d_gpr + 4);
++
++    return method(that, d_gpr[0], d_gpr[1], d_gpr[2], d_gpr[3], d_fpr[0], d_fpr[1], d_fpr[2], d_fpr[3]);
+ }
+ 


More information about the scm-commits mailing list