57077a
# HG changeset patch
57077a
# User msirringhaus@suse.de
57077a
# Date 1558452408 -7200
57077a
#      Tue May 21 17:26:48 2019 +0200
57077a
# Node ID 602e92722e765a3c238d3b96b26c0c8063b5eeb4
57077a
# Parent  a3cc550d25e3a04d906f516928cbcbe50efd585e
57077a
[mq]: mozilla-s390-context.patch
57077a
57077a
diff -r a3cc550d25e3 -r 602e92722e76 js/src/wasm/WasmSignalHandlers.cpp
57077a
--- a/js/src/wasm/WasmSignalHandlers.cpp	Tue May 21 17:22:06 2019 +0200
57077a
+++ b/js/src/wasm/WasmSignalHandlers.cpp	Tue May 21 17:26:48 2019 +0200
57077a
@@ -154,6 +154,10 @@
57077a
 #    define R01_sig(p) ((p)->uc_mcontext.gp_regs[1])
57077a
 #    define R32_sig(p) ((p)->uc_mcontext.gp_regs[32])
57077a
 #  endif
57077a
+#  if defined(__linux__) && defined(__s390x__)
57077a
+#    define GR_sig(p,x) ((p)->uc_mcontext.gregs[x])
57077a
+#    define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
57077a
+#  endif
57077a
 #elif defined(__NetBSD__)
57077a
 #  define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
57077a
 #  define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
57077a
@@ -385,8 +389,13 @@
57077a
 #  define PC_sig(p) R32_sig(p)
57077a
 #  define SP_sig(p) R01_sig(p)
57077a
 #  define FP_sig(p) R01_sig(p)
57077a
+#elif defined(__s390x__)
57077a
+# define PC_sig(p) PSWa_sig(p)
57077a
+# define SP_sig(p) GR_sig(p, 15)
57077a
+# define FP_sig(p) GR_sig(p, 11)
57077a
 #endif
57077a
 
57077a
+
57077a
 static void SetContextPC(CONTEXT* context, uint8_t* pc) {
57077a
 #ifdef PC_sig
57077a
   *reinterpret_cast<uint8_t**>(&PC_sig(context)) = pc;