summaryrefslogtreecommitdiffstats
path: root/lib/libc_r
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2004-01-22 19:15:08 +0000
committerdeischen <deischen@FreeBSD.org>2004-01-22 19:15:08 +0000
commit74d800d7d0417d49b6abd3cbf7040e2a5c76ac4e (patch)
tree20c115679d14ffbb9efa1dc9c883e2029e87b17b /lib/libc_r
parent82cb47ce10b1d95ba2a76209046c121736a5dddb (diff)
downloadFreeBSD-src-74d800d7d0417d49b6abd3cbf7040e2a5c76ac4e.zip
FreeBSD-src-74d800d7d0417d49b6abd3cbf7040e2a5c76ac4e.tar.gz
Initialize the (i386) frame pointer when setting up a thread
context. Submitted by: Marc Olzheim <marcolz@stack.nl> Tested by: Marc Olzheim <marcolz@stack.nl>
Diffstat (limited to 'lib/libc_r')
-rw-r--r--lib/libc_r/uthread/pthread_private.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc_r/uthread/pthread_private.h b/lib/libc_r/uthread/pthread_private.h
index 6807f2f..f83e2f4 100644
--- a/lib/libc_r/uthread/pthread_private.h
+++ b/lib/libc_r/uthread/pthread_private.h
@@ -86,7 +86,10 @@
fdata = (char *) (ucp)->uc_mcontext.mc_fpstate; \
__asm__("frstor %0": :"m"(*fdata)); \
} while (0)
-#define SET_RETURN_ADDR_JB(jb, ra) (jb)[0]._jb[0] = (int)(ra)
+#define SET_RETURN_ADDR_JB(jb, ra) do { \
+ (jb)[0]._jb[0] = (int)(ra); \
+ (jb)[0]._jb[3] = 0; \
+} while (0)
#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]))
OpenPOWER on IntegriCloud