From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 22 02:16:47 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 577D916A4CF for ; Thu, 22 Jan 2004 02:16:47 -0800 (PST) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 341D743D2F for ; Thu, 22 Jan 2004 02:16:43 -0800 (PST) (envelope-from marcolz@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [2001:610:1108:5010:2e0:81ff:fe22:51d8]) by mailhost.stack.nl (Postfix) with ESMTP id 400FA309#E8A381F00F; Thu, 22 Jan 2004 11:16:41 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 333) id CAC841CC71; Thu, 22 Jan 2004 11:16:41 +0100 (CET) Date: Thu, 22 Jan 2004 11:16:41 +0100 From: Marc Olzheim To: hackers@freebsd.org Message-ID: <20040122101641.GA82155@stack.nl> References: <20040121211344.GA97203@stack.nl> <20040121220916.GC97291@stack.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="bp/iNruPH9dso1Pn" Content-Disposition: inline In-Reply-To: <20040121220916.GC97291@stack.nl> X-Operating-System: FreeBSD turtle.stack.nl 5.2-BETA FreeBSD 5.2-BETA X-URL: http://www.stack.nl/~marcolz/ User-Agent: Mutt/1.5.5.1i Subject: Re: libc_r/uthread/uthread_create.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 10:16:47 -0000 --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--