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