From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HFBwe-00020M-Oi for qemu-devel@nongnu.org; Thu, 08 Feb 2007 11:16:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HFBwd-0001zW-7P for qemu-devel@nongnu.org; Thu, 08 Feb 2007 11:16:24 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFBwd-0001zP-20 for qemu-devel@nongnu.org; Thu, 08 Feb 2007 11:16:23 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HFBwc-0001zf-E7 for qemu-devel@nongnu.org; Thu, 08 Feb 2007 11:16:22 -0500 From: Paul Brook Subject: Re: [Qemu-devel] Re: strange crash on FreeBSD-current/amd64 (pointertruncation?) Date: Thu, 8 Feb 2007 16:09:29 +0000 References: <61EB814CF63D9642BA6DD5B76DB0894306DAC0@mx-met-exch0.scisys.co.uk> <200702080809.54787.rob@landley.net> In-Reply-To: <200702080809.54787.rob@landley.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702081609.30126.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Thursday 08 February 2007 13:09, Rob Landley wrote: > On Friday 02 February 2007 2:03 pm, Gwenole Beauchesne wrote: > > On Fri, 2 Feb 2007, Gwenole Beauchesne wrote: > > > The proper fix would be to not globally allocate registers for the > > > whole program but only for the micro-ops. Then, make the necessary > > > save/restore around the gen_func call. > > > > Hmm, I realized in the train that this wouldn't work for QEMU. > > > > > + /* Preserve callee-saved registers */ > > > +#ifdef AREG0 > > > + register unsigned long reg_AREG0 asm(AREG0); > > > + volatile unsigned long saved_AREG0; > > > +#endif > > > > BTW, better read (unsigned long) as (void *) or uintptr_t in case you > > ever want to port QEMU to Win64 or other strange LLP64 platform. (void *) is no better that (unsigned long). (void *) will break on 64-bit ILP32 targets (eg. ia64-hpux, and some ppc targets). Paul