Kaynağa Gözat

accel/tcg: Restrict tlb_init() / destroy() to TCG

Move CPU TLB related methods to accel/tcg/ scope,
in "internal-common.h".

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250123234415.59850-9-philmd@linaro.org>
Philippe Mathieu-Daudé 7 ay önce
ebeveyn
işleme
cbaae5338b

+ 11 - 0
accel/tcg/internal-common.h

@@ -53,6 +53,17 @@ TranslationBlock *tb_link_page(TranslationBlock *tb);
 void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
 void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
                                uintptr_t host_pc);
                                uintptr_t host_pc);
 
 
+/**
+ * tlb_init - initialize a CPU's TLB
+ * @cpu: CPU whose TLB should be initialized
+ */
+void tlb_init(CPUState *cpu);
+/**
+ * tlb_destroy - destroy a CPU's TLB
+ * @cpu: CPU whose TLB should be destroyed
+ */
+void tlb_destroy(CPUState *cpu);
+
 bool tcg_exec_realizefn(CPUState *cpu, Error **errp);
 bool tcg_exec_realizefn(CPUState *cpu, Error **errp);
 void tcg_exec_unrealizefn(CPUState *cpu);
 void tcg_exec_unrealizefn(CPUState *cpu);
 
 

+ 11 - 0
accel/tcg/user-exec-stub.c

@@ -1,6 +1,7 @@
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 #include "hw/core/cpu.h"
 #include "hw/core/cpu.h"
 #include "exec/replay-core.h"
 #include "exec/replay-core.h"
+#include "internal-common.h"
 
 
 void cpu_resume(CPUState *cpu)
 void cpu_resume(CPUState *cpu)
 {
 {
@@ -18,6 +19,16 @@ void cpu_exec_reset_hold(CPUState *cpu)
 {
 {
 }
 }
 
 
+/* User mode emulation does not support softmmu yet.  */
+
+void tlb_init(CPUState *cpu)
+{
+}
+
+void tlb_destroy(CPUState *cpu)
+{
+}
+
 /* User mode emulation does not support record/replay yet.  */
 /* User mode emulation does not support record/replay yet.  */
 
 
 bool replay_exception(void)
 bool replay_exception(void)

+ 0 - 16
include/exec/exec-all.h

@@ -29,16 +29,6 @@
 
 
 #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
 #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
 /* cputlb.c */
 /* cputlb.c */
-/**
- * tlb_init - initialize a CPU's TLB
- * @cpu: CPU whose TLB should be initialized
- */
-void tlb_init(CPUState *cpu);
-/**
- * tlb_destroy - destroy a CPU's TLB
- * @cpu: CPU whose TLB should be destroyed
- */
-void tlb_destroy(CPUState *cpu);
 /**
 /**
  * tlb_flush_page:
  * tlb_flush_page:
  * @cpu: CPU whose TLB should be flushed
  * @cpu: CPU whose TLB should be flushed
@@ -223,12 +213,6 @@ void tlb_set_page(CPUState *cpu, vaddr addr,
                   hwaddr paddr, int prot,
                   hwaddr paddr, int prot,
                   int mmu_idx, vaddr size);
                   int mmu_idx, vaddr size);
 #else
 #else
-static inline void tlb_init(CPUState *cpu)
-{
-}
-static inline void tlb_destroy(CPUState *cpu)
-{
-}
 static inline void tlb_flush_page(CPUState *cpu, vaddr addr)
 static inline void tlb_flush_page(CPUState *cpu, vaddr addr)
 {
 {
 }
 }