summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorathenian200 <athenian200@outlook.com>2019-10-02 14:08:55 -0500
committerathenian200 <athenian200@outlook.com>2019-10-21 04:53:41 -0500
commit76c55f747ce5878d1d37d8bf3bd0a50c1b478bec (patch)
tree049b8824bf5f30ac08653311e1204c31287f8af5
parent7966d22df36adfd418c49558611fbd092180ea9b (diff)
downloadUXP-76c55f747ce5878d1d37d8bf3bd0a50c1b478bec.tar
UXP-76c55f747ce5878d1d37d8bf3bd0a50c1b478bec.tar.gz
UXP-76c55f747ce5878d1d37d8bf3bd0a50c1b478bec.tar.lz
UXP-76c55f747ce5878d1d37d8bf3bd0a50c1b478bec.tar.xz
UXP-76c55f747ce5878d1d37d8bf3bd0a50c1b478bec.zip
MoonchildProductions#1251 - Part 12: Add Solaris/illumos support to WasmSignalHandlers.
https://www.illumos.org/issues/5876 https://bugzilla.mozilla.org/show_bug.cgi?id=135050
-rw-r--r--js/src/wasm/WasmSignalHandlers.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
index c4733cc96..21093ca9a 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -130,11 +130,16 @@ class AutoSetHandlingSegFault
# define EPC_sig(p) ((p)->sc_pc)
# define RFP_sig(p) ((p)->sc_regs[30])
# endif
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__sun)
# if defined(__linux__)
# define XMM_sig(p,i) ((p)->uc_mcontext.fpregs->_xmm[i])
# define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP])
-# else
+# else // defined(__sun)
+/* See https://www.illumos.org/issues/5876. They keep arguing over whether
+ * <ucontext.h> should provide the register index defines in regset.h or
+ * require applications to request them specifically, and we need them here. */
+#include <ucontext.h>
+#include <sys/regset.h>
# define XMM_sig(p,i) ((p)->uc_mcontext.fpregs.fp_reg_set.fpchip_state.xmm[i])
# define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_PC])
# endif