Date: Thu, 22 Jan 2004 11:16:41 +0100 From: Marc Olzheim <marcolz@stack.nl> To: hackers@freebsd.org Subject: Re: libc_r/uthread/uthread_create.c Message-ID: <20040122101641.GA82155@stack.nl> In-Reply-To: <20040121220916.GC97291@stack.nl> References: <20040121211344.GA97203@stack.nl> <20040121220916.GC97291@stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
--bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 21, 2004 at 11:09:16PM +0100, Marc Olzheim wrote: > On Wed, Jan 21, 2004 at 10:13:44PM +0100, Marc Olzheim wrote: > > Could someone tell me ? > > Erhm... For some clue what this is about: > http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg44893.html Found it out already, shouldn't be a problem. A new thread doesn't expect to find anything in ebp, so it isn't an issue. Daniel Eischen proposed a simpler patch, which does the same trick... Marc --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pthr.patch" --- /usr/src/lib/libc_r/uthread/pthread_private.h Thu Jan 22 11:06:15 2004 +++ /usr/src/lib/libc_r/uthread/pthread_private.h Thu Jan 22 11:08:57 2004 @@ -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])) --bp/iNruPH9dso1Pn--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040122101641.GA82155>