[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-4.1 v2 07/36] cpu: Introduce env_archcpu
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH for-4.1 v2 07/36] cpu: Introduce env_archcpu |
Date: |
Thu, 28 Mar 2019 13:03:35 -1000 |
This will foo_env_get_cpu with a generic definition.
No changes to the target specific code so far.
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 9fb3f57684..0951fd9053 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 for-4.1 v2 10/36] target/cris: Use env_cpu, env_archcpu, (continued)
- [Qemu-devel] [PATCH for-4.1 v2 10/36] target/cris: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 25/36] target/tilegx: Use env_cpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 27/36] target/unicore32: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 12/36] target/i386: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 08/36] target/alpha: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 15/36] target/microblaze: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 02/36] tcg: Split out target/arch/cpu-param.h, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 04/36] cpu: Define CPUArchState with typedef, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 16/36] target/mips: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 11/36] target/hppa: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 07/36] cpu: Introduce env_archcpu,
Richard Henderson <=
- [Qemu-devel] [PATCH for-4.1 v2 05/36] cpu: Define ArchCPU, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 01/36] tcg: Fold CPUTLBWindow into CPUTLBDesc, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 09/36] target/arm: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 06/36] cpu: Replace ENV_GET_CPU with env_cpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 03/36] tcg: Create struct CPUTLB, Richard Henderson, 2019/03/28
- Re: [Qemu-devel] [PATCH for-4.1 v2 00/36] tcg: Move the softmmu tlb to CPUNegativeOffsetState, no-reply, 2019/03/28