From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYNnz-000144-KO for qemu-devel@nongnu.org; Tue, 04 Aug 2009 13:28:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYNny-00010d-4B for qemu-devel@nongnu.org; Tue, 04 Aug 2009 13:28:06 -0400 Received: from [199.232.76.173] (port=49892 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYNnx-00010N-RL for qemu-devel@nongnu.org; Tue, 04 Aug 2009 13:28:05 -0400 Received: from fg-out-1718.google.com ([72.14.220.158]:1039) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MYNnx-0002Z5-9U for qemu-devel@nongnu.org; Tue, 04 Aug 2009 13:28:05 -0400 Received: by fg-out-1718.google.com with SMTP id l27so821215fgb.8 for ; Tue, 04 Aug 2009 10:28:03 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1249318642-19324-9-git-send-email-lcapitulino@redhat.com> References: <1249318642-19324-1-git-send-email-lcapitulino@redhat.com> <1249318642-19324-9-git-send-email-lcapitulino@redhat.com> From: Blue Swirl Date: Tue, 4 Aug 2009 20:27:43 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH 08/25] monitor: New GET_TLONG and GET_TPHYSADDR macros Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: jan.kiszka@siemens.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, avi@redhat.com 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))) 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.