Message ID | 20240119144024.14289-17-anjo@rev.ng (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Compile accel/tcg once (partially) | expand |
On 1/20/24 00:40, Anton Johansson wrote: > Functions are target independent. > > Signed-off-by: Anton Johansson<anjo@rev.ng> > --- > include/exec/cpu-all.h | 25 ------------------------- > include/exec/cpu-common.h | 25 +++++++++++++++++++++++++ > 2 files changed, 25 insertions(+), 25 deletions(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
On 1/20/24 00:40, Anton Johansson wrote: > --- a/include/exec/cpu-common.h > +++ b/include/exec/cpu-common.h > @@ -347,4 +347,29 @@ G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); > */ > #define PAGE_PASSTHROUGH 0x0800 > > +/* accel/tcg/cpu-exec.c */ > +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 (void *)env - sizeof(CPUState); > +} > + > +/** > + * env_cpu(env) > + * @env: The architecture environment > + * > + * Return the CPUState associated with the environment. > + */ > +static inline CPUState *env_cpu(CPUArchState *env) > +{ > + return (void *)env - sizeof(CPUState); > +} > + > #endif /* CPU_COMMON_H */ Missing include of hw/core/cpu.h, as far as I can see? r~
On 1/28/24 08:14, Richard Henderson wrote: > On 1/20/24 00:40, Anton Johansson wrote: >> --- a/include/exec/cpu-common.h >> +++ b/include/exec/cpu-common.h >> @@ -347,4 +347,29 @@ G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); >> */ >> #define PAGE_PASSTHROUGH 0x0800 >> +/* accel/tcg/cpu-exec.c */ >> +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 (void *)env - sizeof(CPUState); >> +} >> + >> +/** >> + * env_cpu(env) >> + * @env: The architecture environment >> + * >> + * Return the CPUState associated with the environment. >> + */ >> +static inline CPUState *env_cpu(CPUArchState *env) >> +{ >> + return (void *)env - sizeof(CPUState); >> +} >> + >> #endif /* CPU_COMMON_H */ > > Missing include of hw/core/cpu.h, as far as I can see? Queued, with this fix. r~
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 968fbd4d16..4778976c4b 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -295,33 +295,8 @@ CPUArchState *cpu_copy(CPUArchState *env); | CPU_INTERRUPT_TGT_EXT_3 \ | CPU_INTERRUPT_TGT_EXT_4) -/* accel/tcg/cpu-exec.c */ -int cpu_exec(CPUState *cpu); - /* Validate correct placement of CPUArchState. */ QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0); QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState)); -/** - * env_archcpu(env) - * @env: The architecture environment - * - * Return the ArchCPU associated with the environment. - */ -static inline ArchCPU *env_archcpu(CPUArchState *env) -{ - return (void *)env - sizeof(CPUState); -} - -/** - * env_cpu(env) - * @env: The architecture environment - * - * Return the CPUState associated with the environment. - */ -static inline CPUState *env_cpu(CPUArchState *env) -{ - return (void *)env - sizeof(CPUState); -} - #endif /* CPU_ALL_H */ diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index d3c8b2cf55..25e50aaa37 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -347,4 +347,29 @@ G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); */ #define PAGE_PASSTHROUGH 0x0800 +/* accel/tcg/cpu-exec.c */ +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 (void *)env - sizeof(CPUState); +} + +/** + * env_cpu(env) + * @env: The architecture environment + * + * Return the CPUState associated with the environment. + */ +static inline CPUState *env_cpu(CPUArchState *env) +{ + return (void *)env - sizeof(CPUState); +} + #endif /* CPU_COMMON_H */
Functions are target independent. Signed-off-by: Anton Johansson <anjo@rev.ng> --- include/exec/cpu-all.h | 25 ------------------------- include/exec/cpu-common.h | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-)