pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
coreclr-git: Add support for NetBSD FP regs
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Tue Feb 9 02:47:06 2016 +0100
Changeset: f12aa92e078bd294b6819f8a2e5f15ca2907907a
Modified Files:
coreclr-git/distinfo
Added Files:
coreclr-git/patches/patch-src_pal_src_include_pal_context.h
coreclr-git/patches/patch-src_pal_src_thread_context.cpp
Log Message:
coreclr-git: Add support for NetBSD FP regs
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f12aa92e078bd294b6819f8a2e5f15ca2907907a
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
coreclr-git/distinfo | 2 ++
.../patch-src_pal_src_include_pal_context.h | 25 ++++++++++++++++++
.../patches/patch-src_pal_src_thread_context.cpp | 30 ++++++++++++++++++++++
3 files changed, 57 insertions(+)
diffs:
diff --git a/coreclr-git/distinfo b/coreclr-git/distinfo
index d975510..466caf1 100644
--- a/coreclr-git/distinfo
+++ b/coreclr-git/distinfo
@@ -1,4 +1,6 @@
$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
diff --git a/coreclr-git/patches/patch-src_pal_src_include_pal_context.h b/coreclr-git/patches/patch-src_pal_src_include_pal_context.h
new file mode 100644
index 0000000..14f02cb
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_include_pal_context.h
@@ -0,0 +1,25 @@
+$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])
diff --git a/coreclr-git/patches/patch-src_pal_src_thread_context.cpp b/coreclr-git/patches/patch-src_pal_src_thread_context.cpp
new file mode 100644
index 0000000..9c6d31d
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_thread_context.cpp
@@ -0,0 +1,30 @@
+$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
Home |
Main Index |
Thread Index |
Old Index