Re: [Qemu-devel] [PATCH RFC v3 05/21] target-arm: Embed CPUARMState in QOM ARMCPU

2012-02-06 Thread Andreas Färber
Am 07.02.2012 00:00, schrieb Anthony Liguori: > On 02/02/2012 08:59 PM, Andreas Färber wrote: >> +static inline Object *arm_env_get_object(CPUARMState *env) >> +{ >> +return OBJECT((void *)(env) - offsetof(ARMCPU, env)); >> +} >> + >> +#define ENV_GET_OBJECT(e) arm_env_get_object(e) > > I'd pr

Re: [Qemu-devel] [PATCH RFC v3 05/21] target-arm: Embed CPUARMState in QOM ARMCPU

2012-02-06 Thread Anthony Liguori
On 02/02/2012 08:59 PM, Andreas Färber wrote: We g_malloc0()'ed CPUARMState ourself, and exec.c's cpu_copy() runs through cpu_init() as well, so we are at liberty to supply the CPUState any way we see fit. Having CPUARMState as field in the QOM CPU allows both to access env from an ARMCPU object

[Qemu-devel] [PATCH RFC v3 05/21] target-arm: Embed CPUARMState in QOM ARMCPU

2012-02-02 Thread Andreas Färber
We g_malloc0()'ed CPUARMState ourself, and exec.c's cpu_copy() runs through cpu_init() as well, so we are at liberty to supply the CPUState any way we see fit. Having CPUARMState as field in the QOM CPU allows both to access env from an ARMCPU object and to access the QOM Object and its ObjectClass