aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-21 12:53:40 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-09 17:00:47 +0100
commitc0ee4dd1552b73bdde90875ce62e036a3ca8a007 (patch)
tree3a88537d1fdff50fe6b03a94be10c12c6e680318
parent0ebdf989c32031019aa0974dbb6b840fca52991e (diff)
downloadqemu-c0ee4dd1552b73bdde90875ce62e036a3ca8a007.zip
qemu-c0ee4dd1552b73bdde90875ce62e036a3ca8a007.tar.gz
qemu-c0ee4dd1552b73bdde90875ce62e036a3ca8a007.tar.bz2
cpus: Restrict cpu_has_work() to system emulation
This method is not used on user emulation, because there is always work to do there. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250125170125.32855-2-philmd@linaro.org>
-rw-r--r--include/hw/core/cpu.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index c6df426..2d4ebb7 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -750,6 +750,20 @@ int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs);
*/
bool cpu_virtio_is_big_endian(CPUState *cpu);
+/**
+ * cpu_has_work:
+ * @cpu: The vCPU to check.
+ *
+ * Checks whether the CPU has work to do.
+ *
+ * Returns: %true if the CPU has work, %false otherwise.
+ */
+static inline bool cpu_has_work(CPUState *cpu)
+{
+ g_assert(cpu->cc->has_work);
+ return cpu->cc->has_work(cpu);
+}
+
#endif /* CONFIG_USER_ONLY */
/**
@@ -817,20 +831,6 @@ CPUState *cpu_create(const char *typename);
const char *parse_cpu_option(const char *cpu_option);
/**
- * cpu_has_work:
- * @cpu: The vCPU to check.
- *
- * Checks whether the CPU has work to do.
- *
- * Returns: %true if the CPU has work, %false otherwise.
- */
-static inline bool cpu_has_work(CPUState *cpu)
-{
- g_assert(cpu->cc->has_work);
- return cpu->cc->has_work(cpu);
-}
-
-/**
* qemu_cpu_is_self:
* @cpu: The vCPU to check against.
*