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

Re: [Xen-devel] [PATCH] Add instruction fetching function to x86_emulate_ops.



On Fri, May 26, 2006 at 08:23:45PM +0200, Petersson, Mats wrote:
> Attached patch introduces a separate function to fetch instruction
> bytes, comapared to the read_std. It has the same parameters as the
> read_std call, so there's actually no change to the behaviour in the
> existing code, but when we introduce x86_emulate.c into QEMU, we will
> benefit from knowing that it's instruction bytes being fetched, compared
> to regular byte(s)-from-memory fetching. 
> 
> Signed off by: Mats Petersson <mats.petersson@xxxxxxx>

[snip]

> +#define insn_fetch(_type, _size, _eip)                                    \
> +({ unsigned long _x;                                                      \
> +   rc = ops->fetch_insn_bytes((unsigned long)(_eip), &_x, (_size), ctxt); \
> +   if ( rc != 0 )                                                         \
> +       goto done;                                                         \
> +   (_eip) += (_size);                                                     \
> +   (_type)_x;

I realized you only changed the op call here, but using goto from
inside a macro is EVIL. Can this be done more sanely?

Cheers,
Muli


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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