From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYPuX-0002If-7P for qemu-devel@nongnu.org; Tue, 04 Aug 2009 15:43:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYPuS-0002C8-BB for qemu-devel@nongnu.org; Tue, 04 Aug 2009 15:43:00 -0400 Received: from [199.232.76.173] (port=40871 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYPuS-0002Bu-7j for qemu-devel@nongnu.org; Tue, 04 Aug 2009 15:42:56 -0400 Received: from mx2.redhat.com ([66.187.237.31]:40742) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MYPuQ-0000dX-Kp for qemu-devel@nongnu.org; Tue, 04 Aug 2009 15:42:55 -0400 Date: Tue, 4 Aug 2009 16:42:44 -0300 From: Luiz Capitulino Subject: Re: [Qemu-devel] [PATCH 08/25] monitor: New GET_TLONG and GET_TPHYSADDR macros Message-ID: <20090804164244.2cdcdf27@doriath> In-Reply-To: References: <1249318642-19324-1-git-send-email-lcapitulino@redhat.com> <1249318642-19324-9-git-send-email-lcapitulino@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: jan.kiszka@siemens.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, avi@redhat.com On Tue, 4 Aug 2009 20:27:43 +0300 Blue Swirl wrote: > On Mon, Aug 3, 2009 at 7:57 PM, Luiz Capitulino wrote: > > When we start porting handlers to use the Monitor's dictionary > > to pass argments, we will turn function parameters into automatic > > variables. > > > > This will make the build brake when the 32 bits versions of > > GET_TLONG and GET_TPHYSADDR are used, because the 'h' argument > > will not be used. > > > > The best solution I could think for this problem was changing > > both macros to reassign the 'h' parameter when compiled for > > 32 bits. > > > > I'm open for better solutions, though. > > How about: > > #define GET_TLONG(h, l) ((target_ulong)(((uint64_t)(h) << 32) | (l))) > #define GET_TPHYSADDR(h, l) ((target_phys_addr_t)(((uint64_t)(h) << 32) | (l))) Yes, it will work I think. Would you mind waiting for it to get merged to be changed? I wouldn't like to patchbomb the list because of this change. > This may introduce new Sparse warnings about truncating cast, but > there are already a lot of those. > > I'd use GET_TADDR instead of GET_TPHYSADDR, TADDR is already used by qdev code. Ok, will have a look, but this kind of change is not part of this series.