[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 07/39] cpu: Introduce env_archcpu
From: |
Alistair Francis |
Subject: |
Re: [Qemu-devel] [PATCH v3 07/39] cpu: Introduce env_archcpu |
Date: |
Thu, 9 May 2019 10:52:12 -0700 |
On Tue, May 7, 2019 at 5:07 PM Richard Henderson
<address@hidden> wrote:
>
> This will replace foo_env_get_cpu with a generic definition.
> No changes to the target specific code so far.
>
> Reviewed-by: Peter Maydell <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Alistair
> ---
> include/exec/cpu-all.h | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
> index 454f6d663f..c62f07b354 100644
> --- a/include/exec/cpu-all.h
> +++ b/include/exec/cpu-all.h
> @@ -371,6 +371,17 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
>
> int cpu_exec(CPUState *cpu);
>
> +/**
> + * env_archcpu(env)
> + * @env: The architecture environment
> + *
> + * Return the ArchCPU associated with the environment.
> + */
> +static inline ArchCPU *env_archcpu(CPUArchState *env)
> +{
> + return container_of(env, ArchCPU, env);
> +}
> +
> /**
> * env_cpu(env)
> * @env: The architecture environment
> @@ -379,8 +390,7 @@ int cpu_exec(CPUState *cpu);
> */
> static inline CPUState *env_cpu(CPUArchState *env)
> {
> - ArchCPU *arch_cpu = container_of(env, ArchCPU, env);
> - return &arch_cpu->parent_obj;
> + return &env_archcpu(env)->parent_obj;
> }
>
> #endif /* CPU_ALL_H */
> --
> 2.17.1
>
>
- [Qemu-devel] [PATCH v3 00/39] tcg: Move the softmmu tlb to CPUNegativeOffsetState, Richard Henderson, 2019/05/07
- [Qemu-devel] [PATCH v3 01/39] tcg: Fold CPUTLBWindow into CPUTLBDesc, Richard Henderson, 2019/05/07
- [Qemu-devel] [PATCH v3 04/39] cpu: Define CPUArchState with typedef, Richard Henderson, 2019/05/07
- [Qemu-devel] [PATCH v3 08/39] target/alpha: Use env_cpu, env_archcpu, Richard Henderson, 2019/05/07
- [Qemu-devel] [PATCH v3 07/39] cpu: Introduce env_archcpu, Richard Henderson, 2019/05/07
- Re: [Qemu-devel] [PATCH v3 07/39] cpu: Introduce env_archcpu,
Alistair Francis <=
- [Qemu-devel] [PATCH v3 03/39] tcg: Create struct CPUTLB, Richard Henderson, 2019/05/07
- [Qemu-devel] [PATCH v3 05/39] cpu: Define ArchCPU, Richard Henderson, 2019/05/07
- [Qemu-devel] [PATCH v3 02/39] tcg: Split out target/arch/cpu-param.h, Richard Henderson, 2019/05/07
- [Qemu-devel] [PATCH v3 12/39] target/cris: Use env_cpu, env_archcpu, Richard Henderson, 2019/05/07
- [Qemu-devel] [PATCH v3 10/39] target/cris: Reindent mmu.c, Richard Henderson, 2019/05/07
- [Qemu-devel] [PATCH v3 11/39] target/cris: Reindent op_helper.c, Richard Henderson, 2019/05/07