PERFORCE change 32056 for review
Peter Wemm
peter at FreeBSD.org
Thu May 29 14:52:45 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=32056
Change 32056 by peter at peter_hammer on 2003/05/29 14:52:32
initial attempt. compiles, but is broken.
Affected files ...
.. //depot/projects/hammer/lib/libc_r/uthread/pthread_private.h#7 edit
.. //depot/projects/hammer/lib/libc_r/uthread/uthread_kern.c#6 edit
.. //depot/projects/hammer/lib/libc_r/uthread/uthread_sig.c#5 edit
Differences ...
==== //depot/projects/hammer/lib/libc_r/uthread/pthread_private.h#7 (text+ko) ====
@@ -87,6 +87,18 @@
__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 { \
+} while (0)
+#define FP_RESTORE_UC(ucp) do { \
+} 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]))
==== //depot/projects/hammer/lib/libc_r/uthread/uthread_kern.c#6 (text+ko) ====
@@ -51,7 +51,7 @@
#include <pthread.h>
#include "pthread_private.h"
-/* #define DEBUG_THREAD_KERN */
+#define DEBUG_THREAD_KERN
#ifdef DEBUG_THREAD_KERN
#define DBG_MSG stdout_debug
#else
==== //depot/projects/hammer/lib/libc_r/uthread/uthread_sig.c#5 (text+ko) ====
@@ -1043,7 +1043,7 @@
/* Get the top of the threads stack: */
stackp = GET_STACK_JB(thread->ctx.jb);
-#if !defined(__ia64__)
+#if !defined(__ia64__) && !defined(__amd64__)
/*
* Leave a little space on the stack and round down to the
* nearest aligned word:
@@ -1056,6 +1056,8 @@
stackp -= sizeof(struct pthread_signal_frame);
#if defined(__ia64__)
stackp &= ~0xFUL;
+#elif defined(__amd64__)
+ stackp -= 128;
#endif
psf = (struct pthread_signal_frame *) stackp;
@@ -1085,7 +1087,7 @@
/*
* Set up the context:
*/
-#if !defined(__ia64__)
+#if !defined(__ia64__) && !defined(__amd64__)
stackp -= sizeof(double);
#endif
_setjmp(thread->ctx.jb);
More information about the p4-projects
mailing list