mozilla-s390-context.patch
branchfirefox115
changeset 1190 2a24a948b5cf
parent 1181 ba646dddffef
equal deleted inserted replaced
1189:ba0c97b018a6 1190:2a24a948b5cf
     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  6d6ebdace8a9877fe17c1bd14b80307c258c864f
     6 # Parent  783ceb006fcdabe5ad23bd561362e721c7ed5f8c
     7 [mq]: mozilla-s390-context.patch
     7 [mq]: mozilla-s390-context.patch
     8 
     8 
     9 diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/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
    10 --- a/js/src/wasm/WasmSignalHandlers.cpp
    11 +++ b/js/src/wasm/WasmSignalHandlers.cpp
    11 +++ b/js/src/wasm/WasmSignalHandlers.cpp
    12 @@ -163,16 +163,20 @@ using mozilla::DebugOnly;
    12 @@ -174,6 +174,10 @@ using mozilla::DebugOnly;
    13  #      define R03_sig(p) ((p)->uc_mcontext.__gregs[3])
       
    14  #      define RFP_sig(p) ((p)->uc_mcontext.__gregs[22])
       
    15  #    endif
       
    16  #    if defined(__sun__) && defined(__sparc__)
       
    17  #      define PC_sig(p) ((p)->uc_mcontext.gregs[REG_PC])
       
    18  #      define FP_sig(p) ((p)->uc_mcontext.gregs[REG_FPRS])
    13  #      define FP_sig(p) ((p)->uc_mcontext.gregs[REG_FPRS])
    19  #      define SP_sig(p) ((p)->uc_mcontext.gregs[REG_SP])
    14  #      define SP_sig(p) ((p)->uc_mcontext.gregs[REG_SP])
    20  #    endif
    15  #    endif
    21 +#  if defined(__linux__) && defined(__s390x__)
    16 +#    if defined(__linux__) && defined(__s390x__)
    22 +#    define GR_sig(p,x) ((p)->uc_mcontext.gregs[x])
    17 +#      define GR_sig(p, x) ((p)->uc_mcontext.gregs[x])
    23 +#    define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
    18 +#      define PSWa_sig(p) ((p)->uc_mcontext.psw.addr)
    24 +#  endif
    19 +#    endif
    25  #  elif defined(__NetBSD__)
    20  #  elif defined(__NetBSD__)
    26  #    define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
    21  #    define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
    27  #    define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
    22  #    define EBP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EBP])
    28  #    define ESP_sig(p) ((p)->uc_mcontext.__gregs[_REG_ESP])
    23 @@ -416,6 +420,10 @@ struct macos_aarch64_context {
    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 @@ -405,16 +409,20 @@ struct macos_aarch64_context {
       
    34  #    define PC_sig(p) R32_sig(p)
       
    35  #    define SP_sig(p) R01_sig(p)
       
    36  #    define FP_sig(p) R01_sig(p)
       
    37  #  elif defined(__loongarch__)
       
    38  #    define PC_sig(p) EPC_sig(p)
       
    39  #    define FP_sig(p) RFP_sig(p)
    24  #    define FP_sig(p) RFP_sig(p)
    40  #    define SP_sig(p) R03_sig(p)
    25  #    define SP_sig(p) R03_sig(p)
    41  #    define LR_sig(p) RRA_sig(p)
    26  #    define LR_sig(p) RRA_sig(p)
    42 +#  elif defined(__s390x__)
    27 +#  elif defined(__s390x__)
    43 +#    define PC_sig(p) PSWa_sig(p)
    28 +#    define PC_sig(p) PSWa_sig(p)
    44 +#    define SP_sig(p) GR_sig(p, 15)
    29 +#    define SP_sig(p) GR_sig(p, 15)
    45 +#    define FP_sig(p) GR_sig(p, 11)
    30 +#    define FP_sig(p) GR_sig(p, 11)
    46  #  endif
    31  #  elif defined(__riscv)
    47  
    32  #    define PC_sig(p) RPC_sig(p)
    48  static void SetContextPC(CONTEXT* context, uint8_t* pc) {
    33  #    define FP_sig(p) RFP_sig(p)
    49  #  ifdef PC_sig
       
    50    *reinterpret_cast<uint8_t**>(&PC_sig(context)) = pc;
       
    51  #  else
       
    52    MOZ_CRASH();
       
    53  #  endif