[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros |
Date: |
Fri, 22 Feb 2013 19:20:03 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 |
Am 22.02.2013 19:10, schrieb Peter Maydell:
> From: Andreas Färber <address@hidden>
>
> Introduce ENV_OFFSET macros which can be used in non-target-specific
> code that needs to generate TCG instructions which reference CPUState
> fields given the cpu_env register that TCG targets set up with a
> pointer to the CPUArchState struct.
>
> Signed-off-by: Andreas Färber <address@hidden>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> target-alpha/cpu-qom.h | 1 +
> target-arm/cpu-qom.h | 2 ++
> target-cris/cpu-qom.h | 1 +
> target-i386/cpu-qom.h | 1 +
> target-lm32/cpu-qom.h | 1 +
> target-m68k/cpu-qom.h | 1 +
> target-microblaze/cpu-qom.h | 1 +
> target-mips/cpu-qom.h | 1 +
> target-openrisc/cpu.h | 2 ++
> target-ppc/cpu-qom.h | 3 ++-
> target-s390x/cpu-qom.h | 1 +
> target-sh4/cpu-qom.h | 1 +
> target-sparc/cpu-qom.h | 1 +
> target-unicore32/cpu-qom.h | 1 +
> target-xtensa/cpu-qom.h | 1 +
> 15 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/target-alpha/cpu-qom.h b/target-alpha/cpu-qom.h
> index c0f6c6d..252bd14 100644
> --- a/target-alpha/cpu-qom.h
> +++ b/target-alpha/cpu-qom.h
> @@ -72,5 +72,6 @@ static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState
> *env)
>
> #define ENV_GET_CPU(e) CPU(alpha_env_get_cpu(e))
>
> +#define ENV_OFFSET offsetof(AlphaCPU, env)
>
> #endif
[snip]
Compared to my rebased copy of this patch on qom-cpu-10 yours is
dropping a white line per target. I've intentionally used two lines
spacing for grouping and a line between definitions. Matter of taste.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH 1/6] tcg: Document tcg_qemu_tb_exec() and provide constants for low bit uses, (continued)
- [Qemu-devel] [PATCH 6/6] gen-icount.h: Rename gen_icount_start/end to gen_tb_start/end, Peter Maydell, 2013/02/22
- [Qemu-devel] [PATCH 5/6] translate-all.c: Remove cpu_unlink_tb(), Peter Maydell, 2013/02/22
- [Qemu-devel] [PATCH 3/6] cpu-exec: wrap tcg_qemu_tb_exec() in a fn to restore the PC, Peter Maydell, 2013/02/22
- [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros, Peter Maydell, 2013/02/22
- Re: [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros,
Andreas Färber <=
- Re: [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros, Peter Maydell, 2013/02/22
- Re: [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros, Andreas Färber, 2013/02/24
- Re: [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros, Peter Maydell, 2013/02/24
- Re: [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros, Andreas Färber, 2013/02/24
- Re: [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros, Peter Maydell, 2013/02/24
- Re: [Qemu-devel] [PATCH 2/6] cpu: Introduce ENV_OFFSET macros, Andreas Färber, 2013/02/24
Re: [Qemu-devel] [PATCH 0/6] Drop the irredeemably racy cpu_unlink_tb(), Richard Henderson, 2013/02/22