Skip to content

Commit

Permalink
Bug 1532851 - Unbreak BSDs build on powerpc64 after bug 1462566. r=bb…
Browse files Browse the repository at this point in the history
…ouvier 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

--HG--
extra : source : 1f10307fec284c52fbaf8d8423b47e762b9f0990
extra : histedit_source : 57f09ced52ea26952b0571bf93d602327dec8dd3
  • Loading branch information
jbeich committed Mar 6, 2019
1 parent 8f6fa3b commit 3b4edf3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions js/src/wasm/WasmSignalHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ using mozilla::DebugOnly;
# 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])
Expand Down Expand Up @@ -169,6 +174,11 @@ using mozilla::DebugOnly;
# 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)
Expand Down Expand Up @@ -198,6 +208,11 @@ using mozilla::DebugOnly;
# 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)
Expand Down

0 comments on commit 3b4edf3

Please sign in to comment.