[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 20:00:00 +0100 |
On 27 April 2015 at 13:58, Peter Maydell <address@hidden> wrote:
> 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.
...except that qom/cpu.h doesn't have the definition of the
TranslationBlock struct it would need to be able to do that "tb->pc".
* we can't just include exec-all.h from here or otherwise get
the TranslationBlock struct definition, because it is target
CPU dependent
* we can't have the common baseclass in qom/cpu.c provide an
implementation of the synchronize_from_tb method which calls
set_pc, because qom/cpu.c is a common-obj-y sourcefile]
which leaves us with:
* have cpu_synchronize_from_tb() take both tb and tb->pc as args,
which is pretty yucky
* give up and just update the tcg.h comment as above
I think I go for "just update the comment"...
-- PMM
- [Qemu-devel] [PATCH target-arm 0/2] Unused code cleanups, Peter Crosthwaite, 2015/04/26
- [Qemu-devel] [PATCH target-arm 1/2] arm: cpu.h: Remove unused typdefs, Peter Crosthwaite, 2015/04/26
- [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc_from_tb(), Peter Crosthwaite, 2015/04/26
- Re: [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc_from_tb(), Michael Tokarev, 2015/04/27
- Re: [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc_from_tb(), Michael Tokarev, 2015/04/27
- Re: [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc_from_tb(), Peter Maydell, 2015/04/27
- Re: [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc_from_tb(),
Peter Maydell <=
- Re: [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc_from_tb(), Peter Crosthwaite, 2015/04/27
- Re: [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc_from_tb(), Peter Maydell, 2015/04/27
- Re: [Qemu-devel] [PATCH target-arm 2/2] arm: cpu.h: Delete unused cpu_pc_from_tb(), Michael Tokarev, 2015/04/29