1097
|
1 |
# HG changeset patch
|
|
2 |
# User msirringhaus@suse.de
|
|
3 |
# Date 1558452408 -7200
|
|
4 |
# Tue May 21 17:26:48 2019 +0200
|
|
5 |
# Node ID 602e92722e765a3c238d3b96b26c0c8063b5eeb4
|
1173
|
6 |
# Parent 136e1f2c44a3099b3e49a576fa62c8ad77aa431e
|
1097
|
7 |
[mq]: mozilla-s390-context.patch
|
|
8 |
|
1123
|
9 |
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
|
|
10 |
--- a/js/src/wasm/WasmSignalHandlers.cpp
|
|
11 |
+++ b/js/src/wasm/WasmSignalHandlers.cpp
|
1173
|
12 |
@@ -157,16 +157,20 @@ using mozilla::DebugOnly;
|
|
13 |
# define R32_sig(p) ((p)->uc_mcontext.gp_regs[32])
|
1164
|
14 |
# endif
|
1173
|
15 |
# if defined(__linux__) && defined(__loongarch__)
|
|
16 |
# define EPC_sig(p) ((p)->uc_mcontext.pc)
|
|
17 |
# define RRA_sig(p) ((p)->uc_mcontext.gregs[1])
|
|
18 |
# define RSP_sig(p) ((p)->uc_mcontext.gregs[3])
|
|
19 |
# define RFP_sig(p) ((p)->uc_mcontext.gregs[22])
|
1164
|
20 |
# endif
|
1097
|
21 |
+# if defined(__linux__) && defined(__s390x__)
|
|
22 |
+# define GR_sig(p,x) ((p)->uc_mcontext.gregs[x])
|
|
23 |
+# define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
|
|
24 |
+# endif
|
1164
|
25 |
# elif defined(__NetBSD__)
|
|
26 |
# define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
|
|
27 |
# define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
|
|
28 |
# define ESP_sig(p) ((p)->uc_mcontext.__gregs[_REG_ESP])
|
|
29 |
# define RIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RIP])
|
|
30 |
# define RSP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RSP])
|
|
31 |
# define RBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RBP])
|
|
32 |
# define R11_sig(p) ((p)->uc_mcontext.__gregs[_REG_R11])
|
1173
|
33 |
@@ -399,16 +403,20 @@ struct macos_aarch64_context {
|
1164
|
34 |
# define PC_sig(p) R32_sig(p)
|
|
35 |
# define SP_sig(p) R01_sig(p)
|
|
36 |
# define FP_sig(p) R01_sig(p)
|
1173
|
37 |
# elif defined(__loongarch__)
|
|
38 |
# define PC_sig(p) EPC_sig(p)
|
|
39 |
# define FP_sig(p) RFP_sig(p)
|
|
40 |
# define SP_sig(p) RSP_sig(p)
|
|
41 |
# define LR_sig(p) RRA_sig(p)
|
1164
|
42 |
+# elif defined(__s390x__)
|
|
43 |
+# define PC_sig(p) PSWa_sig(p)
|
|
44 |
+# define SP_sig(p) GR_sig(p, 15)
|
|
45 |
+# define FP_sig(p) GR_sig(p, 11)
|
|
46 |
# endif
|
1097
|
47 |
|
|
48 |
static void SetContextPC(CONTEXT* context, uint8_t* pc) {
|
1164
|
49 |
# ifdef PC_sig
|
1097
|
50 |
*reinterpret_cast<uint8_t**>(&PC_sig(context)) = pc;
|
1164
|
51 |
# else
|
1123
|
52 |
MOZ_CRASH();
|
1164
|
53 |
# endif
|