225ef2
# HG changeset patch
225ef2
# User msirringhaus@suse.de
225ef2
# Date 1558452408 -7200
225ef2
#      Tue May 21 17:26:48 2019 +0200
225ef2
# Node ID 602e92722e765a3c238d3b96b26c0c8063b5eeb4
96931b
# Parent  136e1f2c44a3099b3e49a576fa62c8ad77aa431e
225ef2
[mq]: mozilla-s390-context.patch
225ef2
96931b
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
96931b
--- a/js/src/wasm/WasmSignalHandlers.cpp
96931b
+++ b/js/src/wasm/WasmSignalHandlers.cpp
96931b
@@ -157,16 +157,20 @@ using mozilla::DebugOnly;
96931b
 #      define R32_sig(p) ((p)->uc_mcontext.gp_regs[32])
96931b
 #    endif
96931b
 #    if defined(__linux__) && defined(__loongarch__)
96931b
 #      define EPC_sig(p) ((p)->uc_mcontext.pc)
96931b
 #      define RRA_sig(p) ((p)->uc_mcontext.gregs[1])
96931b
 #      define RSP_sig(p) ((p)->uc_mcontext.gregs[3])
96931b
 #      define RFP_sig(p) ((p)->uc_mcontext.gregs[22])
96931b
 #    endif
225ef2
+#  if defined(__linux__) && defined(__s390x__)
225ef2
+#    define GR_sig(p,x) ((p)->uc_mcontext.gregs[x])
225ef2
+#    define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
225ef2
+#  endif
96931b
 #  elif defined(__NetBSD__)
96931b
 #    define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
96931b
 #    define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
96931b
 #    define ESP_sig(p) ((p)->uc_mcontext.__gregs[_REG_ESP])
96931b
 #    define RIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RIP])
96931b
 #    define RSP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RSP])
96931b
 #    define RBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RBP])
96931b
 #    define R11_sig(p) ((p)->uc_mcontext.__gregs[_REG_R11])
96931b
@@ -399,16 +403,20 @@ struct macos_aarch64_context {
96931b
 #    define PC_sig(p) R32_sig(p)
96931b
 #    define SP_sig(p) R01_sig(p)
96931b
 #    define FP_sig(p) R01_sig(p)
96931b
 #  elif defined(__loongarch__)
96931b
 #    define PC_sig(p) EPC_sig(p)
96931b
 #    define FP_sig(p) RFP_sig(p)
96931b
 #    define SP_sig(p) RSP_sig(p)
96931b
 #    define LR_sig(p) RRA_sig(p)
96931b
+#  elif defined(__s390x__)
96931b
+#    define PC_sig(p) PSWa_sig(p)
96931b
+#    define SP_sig(p) GR_sig(p, 15)
96931b
+#    define FP_sig(p) GR_sig(p, 11)
96931b
 #  endif
225ef2
 
225ef2
 static void SetContextPC(CONTEXT* context, uint8_t* pc) {
96931b
 #  ifdef PC_sig
225ef2
   *reinterpret_cast<uint8_t**>(&PC_sig(context)) = pc;
96931b
 #  else
96931b
   MOZ_CRASH();
96931b
 #  endif