[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 02/30] hw/core: Restrict cpu_has_work() to sysemu
- To: qemu-devel@xxxxxxxxxx
- From: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
- Date: Thu, 2 Sep 2021 18:15:15 +0200
- Cc: Bin Meng <bin.meng@xxxxxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Greg Kurz <groug@xxxxxxxx>, haxm-team@xxxxxxxxx, Kamil Rytarowski <kamil@xxxxxxxxxx>, qemu-ppc@xxxxxxxxxx, Anthony Perard <anthony.perard@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Michael Rolnik <mrolnik@xxxxxxxxx>, qemu-riscv@xxxxxxxxxx, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>, Thomas Huth <thuth@xxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Chris Wulff <crwulff@xxxxxxxxx>, Laurent Vivier <lvivier@xxxxxxxxxx>, Cameron Esfahani <dirty@xxxxxxxxx>, Sunil Muthuswamy <sunilmut@xxxxxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Taylor Simpson <tsimpson@xxxxxxxxxxx>, qemu-s390x@xxxxxxxxxx, Richard Henderson <richard.henderson@xxxxxxxxxx>, Bastian Koppelmann <kbastian@xxxxxxxxxxxxxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Artyom Tarasenko <atar4qemu@xxxxxxxxx>, Aurelien Jarno <aurelien@xxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, Roman Bolshakov <r.bolshakov@xxxxxxxxx>, Laurent Vivier <laurent@xxxxxxxxx>, Cornelia Huck <cohuck@xxxxxxxxxx>, qemu-arm@xxxxxxxxxx, Wenchao Wang <wenchao.wang@xxxxxxxxx>, Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Marek Vasut <marex@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, Colin Xu <colin.xu@xxxxxxxxx>, Claudio Fontana <cfontana@xxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Stafford Horne <shorne@xxxxxxxxx>, Reinoud Zandijk <reinoud@xxxxxxxxxx>, kvm@xxxxxxxxxxxxxxx
- Delivery-date: Thu, 02 Sep 2021 16:16:01 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
cpu_has_work() is only called from system emulation code.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
---
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
|