[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/39] cpu: Introduce env_archcpu
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 07/39] cpu: Introduce env_archcpu |
Date: |
Sun, 9 Jun 2019 19:01:46 -0700 |
This will replace foo_env_get_cpu with a generic definition.
No changes to the target specific code so far.
Reviewed-by: Alistair Francis <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
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] [PULL 00/39] tcg: Move the softmmu tlb to CPUNegativeOffsetState, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 01/39] tcg: Fold CPUTLBWindow into CPUTLBDesc, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 05/39] cpu: Define ArchCPU, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 04/39] cpu: Define CPUArchState with typedef, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 07/39] cpu: Introduce env_archcpu,
Richard Henderson <=
- [Qemu-devel] [PULL 08/39] target/alpha: Use env_cpu, env_archcpu, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 03/39] tcg: Create struct CPUTLB, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 02/39] tcg: Split out target/arch/cpu-param.h, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 10/39] target/cris: Reindent mmu.c, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 12/39] target/cris: Use env_cpu, env_archcpu, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 09/39] target/arm: Use env_cpu, env_archcpu, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 16/39] target/m68k: Use env_cpu, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 11/39] target/cris: Reindent op_helper.c, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 15/39] target/lm32: Use env_cpu, env_archcpu, Richard Henderson, 2019/06/09
- [Qemu-devel] [PULL 13/39] target/hppa: Use env_cpu, env_archcpu, Richard Henderson, 2019/06/09