[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/17] cpu: Introduce cpu_class_set_vmsd()
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH 09/17] cpu: Introduce cpu_class_set_vmsd() |
Date: |
Tue, 12 Mar 2013 10:49:10 +0100 |
This setter avoids redefining each VMStateDescription value to
vmstate_dummy by not referencing the value for CONFIG_USER_ONLY.
Suggested-by: Juan Quintela <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
include/qom/cpu.h | 21 +++++++++++++++++++++
1 Datei geändert, 21 Zeilen hinzugefügt(+)
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 5b1b0d7..90c5f45 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -138,6 +138,27 @@ void cpu_reset(CPUState *cpu);
ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model);
/**
+ * cpu_class_set_vmsd:
+ * @cc: CPU class
+ * @value: Value to set. Unused for %CONFIG_USER_ONLY.
+ *
+ * Sets #VMStateDescription for @cc.
+ *
+ * The @value argument is intentionally discarded for the non-softmmu targets
+ * to avoid linker errors or excessive preprocessor usage. If this behavior
+ * is undesired, you should assign #CPUState.vmsd directly instead.
+ */
+#ifndef CONFIG_USER_ONLY
+static inline void cpu_class_set_vmsd(CPUClass *cc,
+ const struct VMStateDescription *value)
+{
+ cc->vmsd = value;
+}
+#else
+#define cpu_class_set_vmsd(cc, value) ((cc)->vmsd = NULL)
+#endif
+
+/**
* qemu_cpu_has_work:
* @cpu: The vCPU to check.
*
--
1.7.10.4
- [Qemu-devel] [PATCH 01/17] cpu: Fix qemu_get_cpu() to return NULL if CPU not found, (continued)
- [Qemu-devel] [PATCH 01/17] cpu: Fix qemu_get_cpu() to return NULL if CPU not found, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 03/17] cpus: Replace open-coded CPU loop in qmp_memsave() with qemu_get_cpu(), Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 10/17] target-i386: Update VMStateDescription to X86CPU, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 06/17] vmstate: Make vmstate_register() static inline, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 08/17] cpu: Register VMStateDescription through CPUState, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 11/17] target-cris/helper.c: Update Coding Style, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 04/17] target-sh4: Introduce SuperHCPU subclasses, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 07/17] stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLY, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 17/17] target-lm32: Update VMStateDescription to LM32CPU, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 05/17] target-sh4: Move PVR/PRR/CVR into SuperHCPUClass, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 09/17] cpu: Introduce cpu_class_set_vmsd(),
Andreas Färber <=
- [Qemu-devel] [PATCH 02/17] monitor: Use qemu_get_cpu() in monitor_set_cpu(), Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 16/17] target-arm: Override do_interrupt for ARMv7-M profile, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 13/17] exec: Pass CPUState to cpu_reset_interrupt(), Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 15/17] cpu: Replace do_interrupt() by CPUClass::do_interrupt method, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 14/17] cpu: Pass CPUState to cpu_interrupt(), Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 12/17] cpu: Move halted and interrupt_request fields to CPUState, Andreas Färber, 2013/03/12