Bug 901413 - Support GNU/kFreeBSD in AsmJSSignalHandlers.cpp. r=luke, a=bajaj
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 06 Aug 2013 10:09:05 +0900
changeset 153665 d678426f7db6f4fa61aca1d26c967db6e5a2e32b
parent 153664 327509866aa97e3daedc286f0c609b285b95fa46
child 153666 4887af6999dbeb52e1213d9a14dd5be9e294b1ef
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke, bajaj
bugs901413
milestone25.0a2
Bug 901413 - Support GNU/kFreeBSD in AsmJSSignalHandlers.cpp. r=luke, a=bajaj
js/src/ion/AsmJSSignalHandlers.cpp
--- a/js/src/ion/AsmJSSignalHandlers.cpp
+++ b/js/src/ion/AsmJSSignalHandlers.cpp
@@ -97,17 +97,17 @@ using namespace mozilla;
 # define R8_sig(p) ((p)->uc_mcontext.__gregs[_REG_R8])
 # define R9_sig(p) ((p)->uc_mcontext.__gregs[_REG_R9])
 # define R10_sig(p) ((p)->uc_mcontext.__gregs[_REG_R10])
 # define R11_sig(p) ((p)->uc_mcontext.__gregs[_REG_R11])
 # define R12_sig(p) ((p)->uc_mcontext.__gregs[_REG_R12])
 # define R13_sig(p) ((p)->uc_mcontext.__gregs[_REG_R13])
 # define R14_sig(p) ((p)->uc_mcontext.__gregs[_REG_R14])
 # define R15_sig(p) ((p)->uc_mcontext.__gregs[_REG_R15])
-#elif defined(__DragonFly__) || defined(__FreeBSD__)
+#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 # if defined(__DragonFly__)
 #  define XMM_sig(p,i) (((union savefpu *)(p)->uc_mcontext.mc_fpregs)->sv_xmm.sv_xmm[i])
 # else
 #  define XMM_sig(p,i) (((struct savefpu *)(p)->uc_mcontext.mc_fpstate)->sv_xmm[i])
 # endif
 # define EIP_sig(p) ((p)->uc_mcontext.mc_eip)
 # define RIP_sig(p) ((p)->uc_mcontext.mc_rip)
 # define RAX_sig(p) ((p)->uc_mcontext.mc_rax)
@@ -258,24 +258,24 @@ LookupHeapAccess(const AsmJSModule &modu
 
 # if defined(XP_WIN)
 #  include "jswin.h"
 # else
 #  include <signal.h>
 #  include <sys/mman.h>
 # endif
 
-# if defined(__FreeBSD__)
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #  include <sys/ucontext.h> // for ucontext_t, mcontext_t
 # endif
 
 # if defined(JS_CPU_X64)
 #  if defined(__DragonFly__)
 #   include <machine/npx.h> // for union savefpu
-#  elif defined(__FreeBSD__) || defined(__OpenBSD__)
+#  elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
 #   include <machine/fpu.h> // for struct savefpu/fxsave64
 #  endif
 # endif
 
 // Not all versions of the Android NDK define ucontext_t or mcontext_t.
 // Detect this and provide custom but compatible definitions. Note that these
 // follow the GLibc naming convention to access register values from
 // mcontext_t.