mozilla-s390-context.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Mon, 30 Mar 2020 21:49:01 +0200
branchfirefox74
changeset 1123 7fa561e5d7c7
parent 1097 840132a4a9b3
permissions -rw-r--r--
Firefox 74.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     1
# HG changeset patch
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     2
# User msirringhaus@suse.de
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     3
# Date 1558452408 -7200
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     4
#      Tue May 21 17:26:48 2019 +0200
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     5
# Node ID 602e92722e765a3c238d3b96b26c0c8063b5eeb4
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
     6
# Parent  cb0089687ab899846b8229c3741261d50101340e
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     7
[mq]: mozilla-s390-context.patch
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     8
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
     9
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    10
--- a/js/src/wasm/WasmSignalHandlers.cpp
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    11
+++ b/js/src/wasm/WasmSignalHandlers.cpp
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    12
@@ -150,16 +150,20 @@ using mozilla::DebugOnly;
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    13
 #    define FP_sig(p) ((p)->uc_mcontext.mc_fp)
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    14
 #    define SP_sig(p) ((p)->uc_mcontext.mc_i7)
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    15
 #  endif
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    16
 #  if defined(__linux__) && (defined(__ppc64__) || defined(__PPC64__) || \
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    17
                              defined(__ppc64le__) || defined(__PPC64LE__))
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    18
 #    define R01_sig(p) ((p)->uc_mcontext.gp_regs[1])
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    19
 #    define R32_sig(p) ((p)->uc_mcontext.gp_regs[32])
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    20
 #  endif
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    21
+#  if defined(__linux__) && defined(__s390x__)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    22
+#    define GR_sig(p,x) ((p)->uc_mcontext.gregs[x])
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    23
+#    define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    24
+#  endif
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    25
 #elif defined(__NetBSD__)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
 #  define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    27
 #  define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    28
 #  define ESP_sig(p) ((p)->uc_mcontext.__gregs[_REG_ESP])
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    29
 #  define RIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RIP])
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    30
 #  define RSP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RSP])
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    31
 #  define RBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_RBP])
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    32
 #  define R11_sig(p) ((p)->uc_mcontext.__gregs[_REG_R11])
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    33
@@ -381,18 +385,23 @@ struct macos_arm_context {
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    34
 #  define FP_sig(p) RFP_sig(p)
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    35
 #  define SP_sig(p) RSP_sig(p)
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    36
 #  define LR_sig(p) R31_sig(p)
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    37
 #elif defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || \
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    38
     defined(__PPC64LE__)
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    39
 #  define PC_sig(p) R32_sig(p)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    40
 #  define SP_sig(p) R01_sig(p)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    41
 #  define FP_sig(p) R01_sig(p)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    42
+#elif defined(__s390x__)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    43
+# define PC_sig(p) PSWa_sig(p)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    44
+# define SP_sig(p) GR_sig(p, 15)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    45
+# define FP_sig(p) GR_sig(p, 11)
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    46
 #endif
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    47
 
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    48
+
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    49
 static void SetContextPC(CONTEXT* context, uint8_t* pc) {
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    50
 #ifdef PC_sig
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    51
   *reinterpret_cast<uint8_t**>(&PC_sig(context)) = pc;
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    52
 #else
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    53
   MOZ_CRASH();
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    54
 #endif
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    55
 }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
    56