[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 32/47] exec: Move cpu_loop_foo() target agnostic functions to 'cpu
|
From: |
Richard Henderson |
|
Subject: |
[PULL 32/47] exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h' |
|
Date: |
Tue, 3 Oct 2023 10:30:37 -0700 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
While these functions are not TCG specific, they are not target
specific. Move them to "exec/cpu-common.h" so their callers don't
have to be tainted as target specific.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-3-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/exec/cpu-common.h | 32 ++++++++++++++++++++++++++++++++
include/exec/exec-all.h | 30 ------------------------------
2 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 360b8298a4..605b160a7e 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -173,4 +173,36 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
/* vl.c */
void list_cpus(void);
+#ifdef CONFIG_TCG
+/**
+ * cpu_unwind_state_data:
+ * @cpu: the cpu context
+ * @host_pc: the host pc within the translation
+ * @data: output data
+ *
+ * Attempt to load the the unwind state for a host pc occurring in
+ * translated code. If @host_pc is not in translated code, the
+ * function returns false; otherwise @data is loaded.
+ * This is the same unwind info as given to restore_state_to_opc.
+ */
+bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);
+
+/**
+ * cpu_restore_state:
+ * @cpu: the cpu context
+ * @host_pc: the host pc within the translation
+ * @return: true if state was restored, false otherwise
+ *
+ * Attempt to restore the state for a fault occurring in translated
+ * code. If @host_pc is not in translated code no state is
+ * restored and the function returns false.
+ */
+bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
+
+G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
+G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
+#endif /* CONFIG_TCG */
+G_NORETURN void cpu_loop_exit(CPUState *cpu);
+G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
+
#endif /* CPU_COMMON_H */
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 2e4d337805..ee90ef122b 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -27,36 +27,6 @@
#include "exec/translation-block.h"
#include "qemu/clang-tsa.h"
-/**
- * cpu_unwind_state_data:
- * @cpu: the cpu context
- * @host_pc: the host pc within the translation
- * @data: output data
- *
- * Attempt to load the the unwind state for a host pc occurring in
- * translated code. If @host_pc is not in translated code, the
- * function returns false; otherwise @data is loaded.
- * This is the same unwind info as given to restore_state_to_opc.
- */
-bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);
-
-/**
- * cpu_restore_state:
- * @cpu: the cpu context
- * @host_pc: the host pc within the translation
- * @return: true if state was restored, false otherwise
- *
- * Attempt to restore the state for a fault occurring in translated
- * code. If @host_pc is not in translated code no state is
- * restored and the function returns false.
- */
-bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
-
-G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
-G_NORETURN void cpu_loop_exit(CPUState *cpu);
-G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
-G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
-
/**
* cpu_loop_exit_requested:
* @cpu: The CPU state to be tested
--
2.34.1
- [PULL 05/47] accel: Declare AccelClass::cpu_common_[un]realize() handlers, (continued)
- [PULL 05/47] accel: Declare AccelClass::cpu_common_[un]realize() handlers, Richard Henderson, 2023/10/03
- [PULL 12/47] target/*: Add instance_align to all cpu base classes, Richard Henderson, 2023/10/03
- [PULL 06/47] accel/tcg: Have tcg_exec_realizefn() return a boolean, Richard Henderson, 2023/10/03
- [PULL 09/47] accel/tcg: Move CPUTLB definitions from cpu-defs.h, Richard Henderson, 2023/10/03
- [PULL 08/47] target/arm: Replace TARGET_PAGE_ENTRY_EXTRA, Richard Henderson, 2023/10/03
- [PULL 14/47] accel/tcg: Move CPUNegativeOffsetState into CPUState, Richard Henderson, 2023/10/03
- [PULL 20/47] accel/tcg: Remove cpu_set_cpustate_pointers, Richard Henderson, 2023/10/03
- [PULL 22/47] tcg: Remove TCGContext.tlb_fast_offset, Richard Henderson, 2023/10/03
- [PULL 26/47] accel/tcg: Modify atomic_mmu_lookup() to use CPUState, Richard Henderson, 2023/10/03
- [PULL 25/47] accel/tcg: Modify memory access functions to use CPUState, Richard Henderson, 2023/10/03
- [PULL 32/47] exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h',
Richard Henderson <=
- [PULL 13/47] accel/tcg: Validate placement of CPUNegativeOffsetState, Richard Henderson, 2023/10/03
- [PULL 29/47] accel/tcg: Unify user and softmmu do_[st|ld]*_mmu(), Richard Henderson, 2023/10/03
- [PULL 15/47] accel/tcg: Remove CPUState.icount_decr_ptr, Richard Henderson, 2023/10/03
- [PULL 17/47] accel/tcg: Remove cpu_neg(), Richard Henderson, 2023/10/03
- [PULL 11/47] target/arm: Remove size and alignment for cpu subclasses, Richard Henderson, 2023/10/03
- [PULL 07/47] accel/tcg: Restrict tcg_exec_[un]realizefn() to TCG, Richard Henderson, 2023/10/03
- [PULL 16/47] accel/tcg: Move can_do_io to CPUNegativeOffsetState, Richard Henderson, 2023/10/03
- [PULL 21/47] accel/tcg: Remove env_neg(), Richard Henderson, 2023/10/03
- [PULL 24/47] accel/tcg: Modify probe_access_internal() to use CPUState, Richard Henderson, 2023/10/03
- [PULL 19/47] accel/tcg: Replace CPUState.env_ptr with cpu_env(), Richard Henderson, 2023/10/03