Message ID | 20240119144024.14289-18-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: > TCGCPUOps contains an extra function pointer when included with > NEED_CPU_H, these are moved from the middle to the end of the struct. As > such offsets to target independent function pointers don't vary in > target specific and independent code. > > [Move target specfic fields to separate struct?] > > Signed-off-by: Anton Johansson <anjo@rev.ng> Or make these unconditional. Move fake_user_interrupt into the CONFIG_USER_ONLY block and do_interrupt into the system block. r~
On 1/24/24 10:43, Richard Henderson wrote: > On 1/20/24 00:40, Anton Johansson wrote: >> TCGCPUOps contains an extra function pointer when included with >> NEED_CPU_H, these are moved from the middle to the end of the struct. As >> such offsets to target independent function pointers don't vary in >> target specific and independent code. >> >> [Move target specfic fields to separate struct?] >> >> Signed-off-by: Anton Johansson <anjo@rev.ng> > > Or make these unconditional. Move fake_user_interrupt into the CONFIG_USER_ONLY block and > do_interrupt into the system block. I have split the patch in two, made fake_user_interrupt unconditional, and queued. r~
diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 479713a36e..feb849051f 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -49,21 +49,6 @@ struct TCGCPUOps { /** @debug_excp_handler: Callback for handling debug exceptions */ void (*debug_excp_handler)(CPUState *cpu); -#ifdef NEED_CPU_H -#if defined(CONFIG_USER_ONLY) && defined(TARGET_I386) - /** - * @fake_user_interrupt: Callback for 'fake exception' handling. - * - * Simulate 'fake exception' which will be handled outside the - * cpu execution loop (hack for x86 user mode). - */ - void (*fake_user_interrupt)(CPUState *cpu); -#else - /** - * @do_interrupt: Callback for interrupt handling. - */ - void (*do_interrupt)(CPUState *cpu); -#endif /* !CONFIG_USER_ONLY || !TARGET_I386 */ #ifdef CONFIG_USER_ONLY /** * record_sigsegv: @@ -171,8 +156,25 @@ struct TCGCPUOps { bool (*io_recompile_replay_branch)(CPUState *cpu, const TranslationBlock *tb); #endif /* !CONFIG_USER_ONLY */ + +#ifdef NEED_CPU_H +#if defined(CONFIG_USER_ONLY) && defined(TARGET_I386) + /** + * @fake_user_interrupt: Callback for 'fake exception' handling. + * + * Simulate 'fake exception' which will be handled outside the + * cpu execution loop (hack for x86 user mode). + */ + void (*fake_user_interrupt)(CPUState *cpu); +#else + /** + * @do_interrupt: Callback for interrupt handling. + */ + void (*do_interrupt)(CPUState *cpu); +#endif /* !CONFIG_USER_ONLY || !TARGET_I386 */ #endif /* NEED_CPU_H */ + }; #if defined(CONFIG_USER_ONLY)
TCGCPUOps contains an extra function pointer when included with NEED_CPU_H, these are moved from the middle to the end of the struct. As such offsets to target independent function pointers don't vary in target specific and independent code. [Move target specfic fields to separate struct?] Signed-off-by: Anton Johansson <anjo@rev.ng> --- include/hw/core/tcg-cpu-ops.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-)