[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/24] exec: Declare tlb_init/destroy() in 'exec/cputlb.h'
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 14/24] exec: Declare tlb_init/destroy() in 'exec/cputlb.h' |
Date: |
Thu, 14 Nov 2024 02:12:59 +0100 |
Move CPU TLB related methods to "exec/cputlb.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/cputlb.h | 28 +++++++++++++++++++++++-----
include/exec/exec-all.h | 17 -----------------
accel/tcg/cpu-exec.c | 1 +
3 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h
index 6cac7d530f..5386e53806 100644
--- a/include/exec/cputlb.h
+++ b/include/exec/cputlb.h
@@ -22,15 +22,33 @@
#include "exec/cpu-common.h"
-#ifdef CONFIG_TCG
+#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
+
+/**
+ * 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);
-#if !defined(CONFIG_USER_ONLY)
-/* cputlb.c */
void tlb_protect_code(ram_addr_t ram_addr);
void tlb_unprotect_code(ram_addr_t ram_addr);
-#endif
-#endif /* CONFIG_TCG */
+#else
+
+static inline void tlb_init(CPUState *cpu)
+{
+}
+static inline void tlb_destroy(CPUState *cpu)
+{
+}
+
+#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */
#ifndef CONFIG_USER_ONLY
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 2c06e54387..d792203773 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -47,17 +47,6 @@ static inline bool cpu_loop_exit_requested(CPUState *cpu)
}
#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
-/* 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:
* @cpu: CPU whose TLB should be flushed
@@ -242,12 +231,6 @@ void tlb_set_page(CPUState *cpu, vaddr addr,
hwaddr paddr, int prot,
int mmu_idx, vaddr size);
#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)
{
}
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 8163295f34..8770493590 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -24,6 +24,7 @@
#include "hw/core/tcg-cpu-ops.h"
#include "trace.h"
#include "disas/disas.h"
+#include "exec/cputlb.h"
#include "exec/exec-all.h"
#include "tcg/tcg.h"
#include "qemu/atomic.h"
--
2.45.2
- Re: [PATCH 09/24] target/arm/mte: Restrict 'exec/ram_addr.h' to system emulation, (continued)
- [PATCH 10/24] target/arm/cpu: Restrict cpu_untagged_addr() to user emulation, Philippe Mathieu-Daudé, 2024/11/13
- [PATCH 11/24] exec: Introduce 'user/guest-host.h' header, Philippe Mathieu-Daudé, 2024/11/13
- [PATCH 12/24] accel/tcg: Have tlb_vaddr_to_host() use vaddr type, Philippe Mathieu-Daudé, 2024/11/13
- [PATCH 14/24] exec: Declare tlb_init/destroy() in 'exec/cputlb.h',
Philippe Mathieu-Daudé <=
- [PATCH 13/24] exec: Declare tlb_reset_dirty*() in 'exec/cputlb.h', Philippe Mathieu-Daudé, 2024/11/13
- [PATCH 15/24] exec: Declare tlb_set_page_full() in 'exec/cputlb.h', Philippe Mathieu-Daudé, 2024/11/13