qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc_from_tb()
Date: Mon, 27 Apr 2015 13:58:18 +0100

On 27 April 2015 at 13:02, Michael Tokarev <address@hidden> wrote:
> 27.04.2015 04:38, Peter Crosthwaite wrote:
>> No code uses the cpu_pc_from_tb() function. Delete.
>>
>> Signed-off-by: Peter Crosthwaite <address@hidden>
>> ---
>>  target-arm/cpu.h | 9 ---------
>>  1 file changed, 9 deletions(-)
>>
>> diff --git a/target-arm/cpu.h b/target-arm/cpu.h
>> index 7069103..c9c5d30 100644
>> --- a/target-arm/cpu.h
>> +++ b/target-arm/cpu.h
>> @@ -1874,15 +1874,6 @@ static inline void cpu_get_tb_cpu_state(CPUARMState 
>> *env, target_ulong *pc,
>>
>>  #include "exec/exec-all.h"
>>
>> -static inline void cpu_pc_from_tb(CPUARMState *env, TranslationBlock *tb)
>
> This function is also used in target-tricore/cpu.h, and is mentioned
> in comments in tcg/tcg.h.  Should these be removed as well?

The tcg/tcg.h comment should be updated:
 * Otherwise, we gave up on execution of this TB before it started, and
 * the caller must fix up the CPU state by calling the CPU's
 * synchronize_from_tb() method with the next-TB pointer we return.
 * (falling back to calling the CPU's set_pc() method with tb->pc
 * if no synchronize_from_tb() method exists.)

That's a bit clunky though, which suggests we should
have a cpu_synchronize_from_tb() inline function in qom/cpu.h
which does the
        CPUClass *cc = CPU_GET_CLASS(cpu);
        if (cc->synchronize_from_tb) {
            cc->synchronize_from_tb(cpu, tb);
        } else {
            assert(cc->set_pc);
            cc->set_pc(cpu, tb->pc);
        }

bit that cpu-exec.c currently open-codes.

-- PMM



reply via email to

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