On 16 May 2011 18:29, Aurelien Jarno <aurel...@aurel32.net> wrote:
> On Mon, May 16, 2011 at 05:37:03PM +0100, Peter Maydell wrote:
>> You can do this by calling GETPC() from the top level helper function
>> though, right? [OK, we'd need to move the definition out of dyngen-exec.h.]
>
> No we don't need to move it out of dyngen-exec.h. dyngen-exec.h is
> included in target-*/exec.h, as the softmmu helpers, which are included
> in target-*/op_helper.c, call cpu_restore_state().

I meant, assuming we want to reduce the set of helpers which use
the implicit-global-env (ie: back out the patches which made
helpers other than op_helper.c include exec.h). At the moment
you can't get GETPC() without also getting the global-env which
means you have to be in a source file compiled with the right CFLAGS.
Sorry for the lack of clarity.

> For an actual usage of cpu_restore_state() outside of the softmmu
> helpers, you can have a look at target-sh4/op-helper.c, which uses this
> technique for raising most exceptions, and especially the FPU ones.

Sure. It's in a file which has access to global-env, though.

-- PMM

Reply via email to