mozilla-s390-context.patch
changeset 1129 146af4f081b9
parent 1123 7fa561e5d7c7
child 1164 bb219fd0d646
equal deleted inserted replaced
1116:52b1745787cf 1129:146af4f081b9
     1 # HG changeset patch
     1 # HG changeset patch
     2 # User msirringhaus@suse.de
     2 # User msirringhaus@suse.de
     3 # Date 1558452408 -7200
     3 # Date 1558452408 -7200
     4 #      Tue May 21 17:26:48 2019 +0200
     4 #      Tue May 21 17:26:48 2019 +0200
     5 # Node ID 602e92722e765a3c238d3b96b26c0c8063b5eeb4
     5 # Node ID 602e92722e765a3c238d3b96b26c0c8063b5eeb4
     6 # Parent  a3cc550d25e3a04d906f516928cbcbe50efd585e
     6 # Parent  cb0089687ab899846b8229c3741261d50101340e
     7 [mq]: mozilla-s390-context.patch
     7 [mq]: mozilla-s390-context.patch
     8 
     8 
     9 diff -r a3cc550d25e3 -r 602e92722e76 js/src/wasm/WasmSignalHandlers.cpp
     9 diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
    10 --- a/js/src/wasm/WasmSignalHandlers.cpp	Tue May 21 17:22:06 2019 +0200
    10 --- a/js/src/wasm/WasmSignalHandlers.cpp
    11 +++ b/js/src/wasm/WasmSignalHandlers.cpp	Tue May 21 17:26:48 2019 +0200
    11 +++ b/js/src/wasm/WasmSignalHandlers.cpp
    12 @@ -154,6 +154,10 @@
    12 @@ -150,16 +150,20 @@ using mozilla::DebugOnly;
       
    13  #    define FP_sig(p) ((p)->uc_mcontext.mc_fp)
       
    14  #    define SP_sig(p) ((p)->uc_mcontext.mc_i7)
       
    15  #  endif
       
    16  #  if defined(__linux__) && (defined(__ppc64__) || defined(__PPC64__) || \
       
    17                               defined(__ppc64le__) || defined(__PPC64LE__))
    13  #    define R01_sig(p) ((p)->uc_mcontext.gp_regs[1])
    18  #    define R01_sig(p) ((p)->uc_mcontext.gp_regs[1])
    14  #    define R32_sig(p) ((p)->uc_mcontext.gp_regs[32])
    19  #    define R32_sig(p) ((p)->uc_mcontext.gp_regs[32])
    15  #  endif
    20  #  endif
    16 +#  if defined(__linux__) && defined(__s390x__)
    21 +#  if defined(__linux__) && defined(__s390x__)
    17 +#    define GR_sig(p,x) ((p)->uc_mcontext.gregs[x])
    22 +#    define GR_sig(p,x) ((p)->uc_mcontext.gregs[x])
    18 +#    define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
    23 +#    define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
    19 +#  endif
    24 +#  endif
    20  #elif defined(__NetBSD__)
    25  #elif defined(__NetBSD__)
    21  #  define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
    26  #  define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
    22  #  define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
    27  #  define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
    23 @@ -385,8 +389,13 @@
    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])
       
    33 @@ -381,18 +385,23 @@ struct macos_arm_context {
       
    34  #  define FP_sig(p) RFP_sig(p)
       
    35  #  define SP_sig(p) RSP_sig(p)
       
    36  #  define LR_sig(p) R31_sig(p)
       
    37  #elif defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || \
       
    38      defined(__PPC64LE__)
    24  #  define PC_sig(p) R32_sig(p)
    39  #  define PC_sig(p) R32_sig(p)
    25  #  define SP_sig(p) R01_sig(p)
    40  #  define SP_sig(p) R01_sig(p)
    26  #  define FP_sig(p) R01_sig(p)
    41  #  define FP_sig(p) R01_sig(p)
    27 +#elif defined(__s390x__)
    42 +#elif defined(__s390x__)
    28 +# define PC_sig(p) PSWa_sig(p)
    43 +# define PC_sig(p) PSWa_sig(p)
    32  
    47  
    33 +
    48 +
    34  static void SetContextPC(CONTEXT* context, uint8_t* pc) {
    49  static void SetContextPC(CONTEXT* context, uint8_t* pc) {
    35  #ifdef PC_sig
    50  #ifdef PC_sig
    36    *reinterpret_cast<uint8_t**>(&PC_sig(context)) = pc;
    51    *reinterpret_cast<uint8_t**>(&PC_sig(context)) = pc;
       
    52  #else
       
    53    MOZ_CRASH();
       
    54  #endif
       
    55  }
       
    56