[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v11 10/29] target/i386: [tcg] Refactor translate
From: |
Lluís Vilanova |
Subject: |
Re: [Qemu-devel] [PATCH v11 10/29] target/i386: [tcg] Refactor translate_insn |
Date: |
Fri, 07 Jul 2017 11:25:09 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Emilio G Cota writes:
> On Wed, Jun 28, 2017 at 15:57:00 +0300, Lluís Vilanova wrote:
>> Incrementally paves the way towards using the generic instruction translation
>> loop.
>>
>> Signed-off-by: Lluís Vilanova <address@hidden>
>> ---
>> target/i386/translate.c | 72
>> +++++++++++++++++++++++++++++++----------------
>> 1 file changed, 48 insertions(+), 24 deletions(-)
>>
>> diff --git a/target/i386/translate.c b/target/i386/translate.c
>> index 3eee348de7..da4b409d97 100644
>> --- a/target/i386/translate.c
>> +++ b/target/i386/translate.c
>> @@ -4420,15 +4420,17 @@ static void gen_sse(CPUX86State *env, DisasContext
>> *s, int b,
>>
>> /* convert one instruction. s->base.is_jmp is set if the translation must
>> be stopped. Return the next pc value */
>> -static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
>> - target_ulong pc_start)
>> +static target_ulong disas_insn(DisasContextBase *dcbase, CPUState *cpu)
>> {
>> + DisasContext *s = container_of(dcbase, DisasContext, base);
>> + CPUX86State *env = cpu->env_ptr;
> Minor nit: you can pass dc (*s) here directly, no need for container_of
[...]
I prefer not to so that the code will work in the future (i.e., not assuming the
location of base inside disascontext).
Thanks,
Lluis