accel/tcg: Declare cpu_loop_exit_requested() in 'exec/cpu-common.h'
PATCH 1/1 accel/tcg: Declare cpu_loop_exit_requested() in 'exec/cpu-common.h'
Move cpu_loop_exit_requested() declaration to "exec/cpu-common.h", along with the related cpu_loop_exit_noexc(), cpu_loop_exit(), cpu_loop_exit_atomic() and cpu_loop_exit_restore() methods.
---
Based-on: <[email protected]>
--- include/exec/cpu-common.h | 18 ++++++++++++++++++ include/exec/exec-all.h | 17 ----------------- accel/tcg/cpu-exec.c | 2 +- target/arm/tcg/helper-a64.c | 1 + target/s390x/tcg/mem_helper.c | 1 + 5 files changed, 21 insertions(+), 18 deletions(-)
include/exec/cpu-common.h +18 -0
@@ -186,6 +186,7 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,void list_cpus (void );#ifdef CONFIG_TCG +#include "qemu/atomic.h" bool tcg_cflags_has (CPUState *cpu,uint32_t flags);void tcg_cflags_set (CPUState *cpu,uint32_t flags);
@@ -218,6 +219,23 @@ bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);*/ bool cpu_restore_state (CPUState *cpu,uintptr_t host_pc); +/** +* cpu_loop_exit_requested: +* @cpu: The CPU state to be tested +* +* Indicate if somebody asked for a return of the CPU to the main loop +* (e.g., via cpu_exit() or cpu_interrupt()). +* +* This is helpful for architectures that support interruptible +* instructions. After writing back all state to registers/memory, this +* call can be used to check if it makes sense to return to the main loop +* or to continue executing the interruptible instruction. +*/ +static inline bool cpu_loop_exit_requested (CPUState *cpu) +{ +return (int32_t )qatomic_read (&cpu->neg.icount_decr.u32) <0 ; +} + G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu); G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);#endif /* CONFIG_TCG */
include/exec/exec-all.h +0 -17
@@ -27,23 +27,6 @@#include "exec/mmu-access-type.h" #include "exec/translation-block.h" -/** -* cpu_loop_exit_requested: -* @cpu: The CPU state to be tested -* -* Indicate if somebody asked for a return of the CPU to the main loop -* (e.g., via cpu_exit() or cpu_interrupt()). -* -* This is helpful for architectures that support interruptible -* instructions. After writing back all state to registers/memory, this -* call can be used to check if it makes sense to return to the main loop -* or to continue executing the interruptible instruction. -*/ -static inline bool cpu_loop_exit_requested (CPUState *cpu) -{ -return (int32_t )qatomic_read (&cpu->neg.icount_decr.u32) <0 ; -} -#if !defined(CONFIG_USER_ONLY ) && defined(CONFIG_TCG )/* cputlb.c */ /**
accel/tcg/cpu-exec.c +1 -1
@@ -25,7 +25,7 @@#include "hw/core/tcg-cpu-ops.h" #include "trace.h" #include "disas/disas.h" -#include "exec/exec-all.h" +#include "exec/cpu-common.h" #include "exec/page-protection.h" #include "tcg/tcg.h" #include "qemu/atomic.h"
target/arm/tcg/helper-a64.c +1 -0
@@ -29,6 +29,7 @@#include "internals.h" #include "qemu/crc32c.h" #include "exec/exec-all.h" +#include "exec/cpu-common.h" #include "exec/cpu_ldst.h" #include "qemu/int128.h" #include "qemu/atomic128.h"
target/s390x/tcg/mem_helper.c +1 -0
@@ -25,6 +25,7 @@#include "tcg_s390x.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" +#include "exec/cpu-common.h" #include "exec/page-protection.h" #include "exec/cpu_ldst.h" #include "hw/core/tcg-cpu-ops.h"
Signature · 1 line
2.45.2
Quoted 5 lines · Philippe Mathieu-Daudé
Move
cpu_loop_exit_requested()declaration to "exec/cpu-common.h", along with the relatedcpu_loop_exit_noexc(),cpu_loop_exit(),cpu_loop_exit_atomic()andcpu_loop_exit_restore()methods.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Quoted 7 lines · Philippe Mathieu-Daudé
Move
cpu_loop_exit_requested()declaration to "exec/cpu-common.h", along with the relatedcpu_loop_exit_noexc(),cpu_loop_exit(),cpu_loop_exit_atomic()andcpu_loop_exit_restore()methods.Signed-off-by Philippe Mathieu-Daudé<[email protected]>---
Based-on:<[email protected]>
Quoted 7 lines
--- include/exec/cpu-common.h | 18 ++++++++++++++++++ include/exec/exec-all.h | 17 ----------------- accel/tcg/cpu-exec.c | 2 +- target/arm/tcg/helper-a64.c | 1 + target/s390x/tcg/mem_helper.c | 1 + 5 files changed, 21 insertions(+), 18 deletions(-)
r~
Quoted 7 lines · Philippe Mathieu-Daudé
Move
cpu_loop_exit_requested()declaration to "exec/cpu-common.h", along with the relatedcpu_loop_exit_noexc(),cpu_loop_exit(),cpu_loop_exit_atomic()andcpu_loop_exit_restore()methods.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Based-on: <[email protected]>
Quoted 7 lines
--- include/exec/cpu-common.h | 18 ++++++++++++++++++ include/exec/exec-all.h | 17 ----------------- accel/tcg/cpu-exec.c | 2 +- target/arm/tcg/helper-a64.c | 1 + target/s390x/tcg/mem_helper.c | 1 + 5 files changed, 21 insertions(+), 18 deletions(-)
Patch queued.