$NetBSD$
SHA1 (patch-src_pal_inc_pal__char16.h) = 205f6a8533838c192b36bbb00155da1b02e0f629
+SHA1 (patch-src_pal_src_include_pal_context.h) = 211baea6d21db220e621cafb4a6535f453ca8cc7
+SHA1 (patch-src_pal_src_thread_context.cpp) = 04fa57e3023429e9699d777c52999513eed34769
SHA1 (patch-src_pal_tools_gen-buildsys-clang.sh) = 2b701661e4d3bbf68a8d249a35d80e8a83bc563d
--- /dev/null
+$NetBSD$
+
+--- src/pal/src/include/pal/context.h.orig 2016-02-07 15:52:01.000000000 +0000
++++ src/pal/src/include/pal/context.h
+@@ -68,6 +68,20 @@ typedef ucontext_t native_context_t;
+ #define MCREG_R15(mc) ((mc).__gregs[_REG_R15])
+ #define MCREG_EFlags(mc) ((mc).__gregs[_REG_RFLAGS])
+
++#define FPREG_Xmm(uc, index) *(M128A*)&(((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_xmm[index])
++
++#define FPREG_St(uc, index) *(M128A*)&(((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_87_ac[index])
++
++#define FPREG_ControlWord(uc) (((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_cw)
++#define FPREG_StatusWord(uc) (((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_sw)
++#define FPREG_TagWord(uc) (((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_tw)
++#define FPREG_ErrorOffset(uc) (*(DWORD*) &(((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_ip))
++#define FPREG_ErrorSelector(uc) *((WORD*) &(((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_ip) + 2)
++#define FPREG_DataOffset(uc) (*(DWORD*) &(((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_dp))
++#define FPREG_DataSelector(uc) *((WORD*) &(((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_dp) + 2)
++#define FPREG_MxCsr(uc) (((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_mxcsr)
++#define FPREG_MxCsr_Mask(uc) (((struct fxsave*)(&(uc)->uc_mcontext.__fpregs))->fx_mxcsr_mask)
++
+ #else // BIT64
+
+ #define MCREG_Ebx(mc) ((mc).__gregs[_REG_EBX])
--- /dev/null
+$NetBSD$
+
+--- src/pal/src/thread/context.cpp.orig 2016-02-02 22:59:18.000000000 +0000
++++ src/pal/src/thread/context.cpp
+@@ -423,8 +423,12 @@ void CONTEXTToNativeContext(CONST CONTEX
+ }
+ #undef ASSIGN_REG
+
++#if HAVE_GREGSET_T || HAVE_GREGSET_T
+ #if HAVE_GREGSET_T
+ if (native->uc_mcontext.fpregs == nullptr)
++#elif HAVE___GREGSET_T
++ if (native->uc_mcontext.__fpregs == nullptr)
++#endif
+ {
+ // If the pointer to the floating point state in the native context
+ // is not valid, we can't copy floating point registers regardless of
+@@ -492,8 +496,12 @@ void CONTEXTFromNativeContext(const nati
+ }
+ #undef ASSIGN_REG
+
++#if HAVE_GREGSET_T || HAVE___GREGSET_T
+ #if HAVE_GREGSET_T
+ if (native->uc_mcontext.fpregs == nullptr)
++#elif HAVE___GREGSET_T
++ if (native->uc_mcontext.__fpregs == nullptr)
++#endif
+ {
+ // Reset the CONTEXT_FLOATING_POINT bit(s) so it's clear that the floating point
+ // data in the CONTEXT is not valid. Since CONTEXT_FLOATING_POINT is defined as