aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2003-06-02 22:22:52 +0000
committerPeter Wemm <peter@FreeBSD.org>2003-06-02 22:22:52 +0000
commit3aefe09423b8d7573ff4374120bc4d738f5897f5 (patch)
treea6b086a365d2f5b9b0783b8096eb9a95cd6f86c2 /lib
parentb8f8813c6e8777865fa4c49ebe35eac407d7cd9c (diff)
downloadsrc-3aefe09423b8d7573ff4374120bc4d738f5897f5.tar.gz
src-3aefe09423b8d7573ff4374120bc4d738f5897f5.zip
Port libc_r to amd64, and turn it back on for amd64. It passes all of
the same src/lib/libc_r/test/* tests that the other platforms pass.
Notes
Notes: svn path=/head/; revision=115740
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile3
-rw-r--r--lib/libc_r/uthread/pthread_private.h18
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 556e3e6c04d9..6fba6a0df058 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -42,10 +42,11 @@ _csu=csu
.if ${MACHINE_ARCH} != "amd64"
_libstand= libstand
+.endif
+
.if !defined(NOLIBC_R)
_libc_r= libc_r
.endif
-.endif
.if !defined(NO_BIND)
_libbind= libbind
diff --git a/lib/libc_r/uthread/pthread_private.h b/lib/libc_r/uthread/pthread_private.h
index 143772d1ac7f..5569b2014002 100644
--- a/lib/libc_r/uthread/pthread_private.h
+++ b/lib/libc_r/uthread/pthread_private.h
@@ -87,6 +87,24 @@
__asm__("frstor %0": :"m"(*fdata)); \
} while (0)
#define SET_RETURN_ADDR_JB(jb, ra) (jb)[0]._jb[0] = (int)(ra)
+#elif defined(__amd64__)
+#define GET_STACK_JB(jb) ((unsigned long)((jb)[0]._jb[2]))
+#define GET_STACK_SJB(sjb) ((unsigned long)((sjb)[0]._sjb[2]))
+#define GET_STACK_UC(ucp) ((unsigned long)((ucp)->uc_mcontext.mc_rsp))
+#define SET_STACK_JB(jb, stk) (jb)[0]._jb[2] = (long)(stk)
+#define SET_STACK_SJB(sjb, stk) (sjb)[0]._sjb[2] = (long)(stk)
+#define SET_STACK_UC(ucp, stk) (ucp)->uc_mcontext.mc_rsp = (long)(stk)
+#define FP_SAVE_UC(ucp) do { \
+ char *fdata; \
+ fdata = (char *) (ucp)->uc_mcontext.mc_fpstate; \
+ __asm__("fxsave %0": :"m"(*fdata)); \
+} while (0)
+#define FP_RESTORE_UC(ucp) do { \
+ char *fdata; \
+ fdata = (char *) (ucp)->uc_mcontext.mc_fpstate; \
+ __asm__("fxrstor %0": :"m"(*fdata)); \
+} while (0)
+#define SET_RETURN_ADDR_JB(jb, ra) (jb)[0]._jb[0] = (long)(ra)
#elif defined(__alpha__)
#include <machine/reg.h>
#define GET_STACK_JB(jb) ((unsigned long)((jb)[0]._jb[R_SP + 4]))