[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 17/34] hw/core: [CPUTLB] Move target specifics to end of TCGC
|
From: |
Anton Johansson |
|
Subject: |
[RFC PATCH 17/34] hw/core: [CPUTLB] Move target specifics to end of TCGCPUOps |
|
Date: |
Fri, 19 Jan 2024 15:40:07 +0100 |
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(-)
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)
--
2.43.0
- Re: [RFC PATCH 06/34] exec: [VADDR] Move vaddr defines to separate file, (continued)
- [RFC PATCH 10/34] exec: [VADDR] typedef abi_ptr to vaddr, Anton Johansson, 2024/01/19
- [RFC PATCH 08/34] target: [VADDR] Use vaddr in gen_intermediate_code, Anton Johansson, 2024/01/19
- [RFC PATCH 13/34] target: Uninline cpu_get_tb_cpu_state(), Anton Johansson, 2024/01/19
- [RFC PATCH 17/34] hw/core: [CPUTLB] Move target specifics to end of TCGCPUOps,
Anton Johansson <=
- [RFC PATCH 12/34] target: Uninline cpu_mmu_index(), Anton Johansson, 2024/01/19
- [RFC PATCH 18/34] accel/stubs: [CPUTLB] Move xen.h stubs to xen-stub.c, Anton Johansson, 2024/01/19
- [RFC PATCH 24/34] accel/tcg: [CPUTLB] Set mo_te in TCGContext, Anton Johansson, 2024/01/19
- [RFC PATCH 26/34] Wrap target macros in functions, Anton Johansson, 2024/01/19