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

Re: [Xen-devel] [patch] double incrementing l2tab

On 12 May 2005, at 22:06, Scott Parish wrote:

For PAE, l2e_get_phys() will look something like this:

#define l2e_get_phys(_x) ((((u64)(_x).l2_hi & 0x0f) << 32) |\
                                      ((u64)(_x).l2_lo & PAGE_MASK))

Thus l2e_get_phys(++foo) is not safe, as the increment will be evaluated
multiple times and at undefined times.

This leaves the macro to bite you in future. Either make l2e_get_phys() a static inline function, or do something like:

#define l2e_get_phys(_x) ({ \
    u64 __x = (_x); \
    <your macro here but _x -> __x>; \

 -- Keir

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.