Bug 1532851 - Unbreak BSDs build on powerpc64 after bug 1462566. r=bbouvier a=lizzard
authorJan Beich <jbeich@FreeBSD.org>
Wed, 06 Mar 2019 02:35:04 +0000
changeset 516290 4e252aec24d866bc6ad408c05e8cea9d82b06be5
parent 516289 1639f365cc4cf6034fca350ca332a5d2bf32c56b
child 516291 86214b1c530d73f230161888fad6a75c54575f6d
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier, lizzard
bugs1532851, 1462566
milestone66.0
Bug 1532851 - Unbreak BSDs build on powerpc64 after bug 1462566. r=bbouvier a=lizzard Define R32_sig, R01_sig based on: https://github.com/openbsd/src/blob/master/sys/arch/powerpc/include/signal.h https://github.com/netbsd/src/blob/trunk/sys/arch/powerpc/include/mcontext.h https://github.com/freebsd/freebsd/blob/master/sys/powerpc/include/ucontext.h
js/src/wasm/WasmSignalHandlers.cpp
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -97,16 +97,21 @@ using mozilla::DebugOnly;
 #    define RFP_sig(p) ((p)->sc_x[29])
 #    define RLR_sig(p) ((p)->sc_lr)
 #    define R31_sig(p) ((p)->sc_sp)
 #  endif
 #  if defined(__mips__)
 #    define EPC_sig(p) ((p)->sc_pc)
 #    define RFP_sig(p) ((p)->sc_regs[30])
 #  endif
+#  if defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || \
+      defined(__PPC64LE__)
+#    define R01_sig(p) ((p)->sc_frame.fixreg[1])
+#    define R32_sig(p) ((p)->sc_frame.srr0)
+#  endif
 #elif defined(__linux__) || defined(__sun)
 #  if defined(__linux__)
 #    define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP])
 #    define EBP_sig(p) ((p)->uc_mcontext.gregs[REG_EBP])
 #    define ESP_sig(p) ((p)->uc_mcontext.gregs[REG_ESP])
 #  else
 #    define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_PC])
 #    define EBP_sig(p) ((p)->uc_mcontext.gregs[REG_EBP])
@@ -164,16 +169,21 @@ using mozilla::DebugOnly;
 #    define RFP_sig(p) ((p)->uc_mcontext.__gregs[_REG_X29])
 #    define RLR_sig(p) ((p)->uc_mcontext.__gregs[_REG_X30])
 #    define R31_sig(p) ((p)->uc_mcontext.__gregs[_REG_SP])
 #  endif
 #  if defined(__mips__)
 #    define EPC_sig(p) ((p)->uc_mcontext.__gregs[_REG_EPC])
 #    define RFP_sig(p) ((p)->uc_mcontext.__gregs[_REG_S8])
 #  endif
+#  if defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || \
+      defined(__PPC64LE__)
+#    define R01_sig(p) ((p)->uc_mcontext.__gregs[_REG_R1])
+#    define R32_sig(p) ((p)->uc_mcontext.__gregs[_REG_PC])
+#  endif
 #elif defined(__DragonFly__) || defined(__FreeBSD__) || \
     defined(__FreeBSD_kernel__)
 #  define EIP_sig(p) ((p)->uc_mcontext.mc_eip)
 #  define EBP_sig(p) ((p)->uc_mcontext.mc_ebp)
 #  define ESP_sig(p) ((p)->uc_mcontext.mc_esp)
 #  define RIP_sig(p) ((p)->uc_mcontext.mc_rip)
 #  define RSP_sig(p) ((p)->uc_mcontext.mc_rsp)
 #  define RBP_sig(p) ((p)->uc_mcontext.mc_rbp)
@@ -193,16 +203,21 @@ using mozilla::DebugOnly;
 #    define RFP_sig(p) ((p)->uc_mcontext.mc_gpregs.gp_x[29])
 #    define RLR_sig(p) ((p)->uc_mcontext.mc_gpregs.gp_lr)
 #    define R31_sig(p) ((p)->uc_mcontext.mc_gpregs.gp_sp)
 #  endif
 #  if defined(__FreeBSD__) && defined(__mips__)
 #    define EPC_sig(p) ((p)->uc_mcontext.mc_pc)
 #    define RFP_sig(p) ((p)->uc_mcontext.mc_regs[30])
 #  endif
+#  if defined(__FreeBSD__) && (defined(__ppc64__) || defined(__PPC64__) || \
+                               defined(__ppc64le__) || defined(__PPC64LE__))
+#    define R01_sig(p) ((p)->uc_mcontext.mc_gpr[1])
+#    define R32_sig(p) ((p)->uc_mcontext.mc_srr0)
+#  endif
 #elif defined(XP_DARWIN)
 #  define EIP_sig(p) ((p)->thread.uts.ts32.__eip)
 #  define EBP_sig(p) ((p)->thread.uts.ts32.__ebp)
 #  define ESP_sig(p) ((p)->thread.uts.ts32.__esp)
 #  define RIP_sig(p) ((p)->thread.__rip)
 #  define RBP_sig(p) ((p)->thread.__rbp)
 #  define RSP_sig(p) ((p)->thread.__rsp)
 #  define R11_sig(p) ((p)->thread.__r[11])