diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-09-13 17:22:49 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-10-04 11:03:54 -0700 |
commit | b77af26e973705e8fd96cff102fc978ee44043da (patch) | |
tree | 5da84b6520fbcf44ef8d9af06307785744eef835 /include | |
parent | ad75a51e84af9638e4ec51aa1e6ec5f3ff642558 (diff) | |
download | qemu-b77af26e973705e8fd96cff102fc978ee44043da.zip qemu-b77af26e973705e8fd96cff102fc978ee44043da.tar.gz qemu-b77af26e973705e8fd96cff102fc978ee44043da.tar.bz2 |
accel/tcg: Replace CPUState.env_ptr with cpu_env()
Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/exec/cpu-all.h | 1 | ||||
-rw-r--r-- | include/hw/core/cpu.h | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 114ec70..b5116c8 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -431,7 +431,6 @@ int cpu_exec(CPUState *cpu); */ static inline void cpu_set_cpustate_pointers(ArchCPU *cpu) { - cpu->parent_obj.env_ptr = &cpu->env; } /* Validate correct placement of CPUArchState. */ diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 293cedd..e02bc59 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -427,7 +427,6 @@ struct qemu_work_item; * @num_ases: number of CPUAddressSpaces in @cpu_ases * @as: Pointer to the first AddressSpace, for the convenience of targets which * only have a single AddressSpace - * @env_ptr: Pointer to subclass-specific CPUArchState field. * @gdb_regs: Additional GDB registers. * @gdb_num_regs: Number of total registers accessible to GDB. * @gdb_num_g_regs: Number of registers in GDB 'g' packets. @@ -501,8 +500,6 @@ struct CPUState { AddressSpace *as; MemoryRegion *memory; - CPUArchState *env_ptr; - CPUJumpCache *tb_jmp_cache; struct GDBRegisterState *gdb_regs; @@ -582,6 +579,12 @@ struct CPUState { QEMU_BUILD_BUG_ON(offsetof(CPUState, neg) != sizeof(CPUState) - sizeof(CPUNegativeOffsetState)); +static inline CPUArchState *cpu_env(CPUState *cpu) +{ + /* We validate that CPUArchState follows CPUState in cpu-all.h. */ + return (CPUArchState *)(cpu + 1); +} + typedef QTAILQ_HEAD(CPUTailQ, CPUState) CPUTailQ; extern CPUTailQ cpus; |