Bug 1532851 - Unbreak BSDs build on powerpc64 after bug 1462566. r=bbouvier
authorJan Beich <jbeich@FreeBSD.org>
Wed, 06 Mar 2019 02:35:04 +0000
changeset 520478 1f10307fec284c52fbaf8d8423b47e762b9f0990
parent 520477 fb993d3d4e66cb1ff3e63ff1377a5d495f8e4d0a
child 520479 4ab143dde4dc3424cfedc74b3648fbf2e47fb7bf
child 520619 62fac4388d24a131fb8a3637be9f87e44fd86e82
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1532851, 1462566
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1532851 - Unbreak BSDs build on powerpc64 after bug 1462566. r=bbouvier 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
@@ -98,16 +98,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])
@@ -165,16 +170,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)
@@ -194,16 +204,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])