[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 02/30] hw/core: Restrict cpu_has_work() to sysemu
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 02/30] hw/core: Restrict cpu_has_work() to sysemu |
Date: |
Thu, 2 Sep 2021 18:15:15 +0200 |
cpu_has_work() is only called from system emulation code.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/hw/core/cpu.h | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index bc864564cee..2bd563e221f 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -538,6 +538,22 @@ enum CPUDumpFlags {
void cpu_dump_state(CPUState *cpu, FILE *f, int flags);
#ifndef CONFIG_USER_ONLY
+/**
+ * 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)
+{
+ CPUClass *cc = CPU_GET_CLASS(cpu);
+
+ g_assert(cc->has_work);
+ return cc->has_work(cpu);
+}
+
/**
* cpu_get_phys_page_attrs_debug:
* @cpu: The CPU to obtain the physical page address for.
@@ -636,22 +652,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)
-{
- CPUClass *cc = CPU_GET_CLASS(cpu);
-
- g_assert(cc->has_work);
- return cc->has_work(cpu);
-}
-
/**
* qemu_cpu_is_self:
* @cpu: The vCPU to check against.
--
2.31.1
- [PATCH v3 00/30] accel: Move has_work() from SysemuCPUOps to AccelOpsClass, Philippe Mathieu-Daudé, 2021/09/02
- [PATCH v3 01/30] accel/tcg: Restrict cpu_handle_halt() to sysemu, Philippe Mathieu-Daudé, 2021/09/02
- [PATCH v3 02/30] hw/core: Restrict cpu_has_work() to sysemu,
Philippe Mathieu-Daudé <=
- [PATCH v3 03/30] hw/core: Un-inline cpu_has_work(), Philippe Mathieu-Daudé, 2021/09/02
- [PATCH v3 04/30] sysemu: Introduce AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/02
- [PATCH v3 05/30] accel/kvm: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/02
- [PATCH v3 06/30] accel/whpx: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/02
- [PATCH v3 07/30] accel/tcg: Implement AccelOpsClass::has_work() as stub, Philippe Mathieu-Daudé, 2021/09/02