[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 08/25] monitor: New GET_TLONG and GET_TPHYSADDR

From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 08/25] monitor: New GET_TLONG and GET_TPHYSADDR macros
Date: Tue, 4 Aug 2009 20:27:43 +0300

On Mon, Aug 3, 2009 at 7:57 PM, Luiz Capitulino<address@hidden> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]