qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 010/126] target-s390: Reorg exception handling


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 010/126] target-s390: Reorg exception handling
Date: Wed, 19 Sep 2012 13:07:26 +0200

On 19.09.2012, at 02:14, Richard Henderson wrote:

> On 09/18/2012 01:18 PM, Alexander Graf wrote:
>>> -    /* remember what pgm exeption this was */
>>> +    /* Remember what pgm exeption this was.  */
>>>      tmp = tcg_const_i32(code);
>>>      tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUS390XState, int_pgm_code));
>>>      tcg_temp_free_i32(tmp);
>>>  -    tmp = tcg_const_i32(ilc);
>>> +    tmp = tcg_const_i32(s->next_pc - s->pc);
>> 
>> Mind to explain this one?
> 
> ILC = the size of the insn.  Rather than passing ILC around into
> gen_program_exception, get it back from the s->next_pc value that
> we stored into DisasContext.

Ah, makes sense. Maybe create a small helper that makes it more obvious:

static int current_ilc(DisasContext *s)
{
    /* Next pc - current pc = current instruction length. */
    return s->next_pc - s->pc;
}


Alex




reply via email to

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