summaryrefslogtreecommitdiffstats
path: root/hw/core/cpu.c
diff options
context:
space:
mode:
authorEduardo Habkost2020-12-11 23:04:59 +0100
committerEduardo Habkost2020-12-15 16:02:07 +0100
commit1b36e4f5a5de585210ea95f2257839c2312be28f (patch)
treed6c9e2ebe24cfabdad88c9a083aad686e3fdc4bd /hw/core/cpu.c
parentcs4231: Get rid of empty property array (diff)
downloadqemu-1b36e4f5a5de585210ea95f2257839c2312be28f.tar.gz
qemu-1b36e4f5a5de585210ea95f2257839c2312be28f.tar.xz
qemu-1b36e4f5a5de585210ea95f2257839c2312be28f.zip
cpu: Move cpu_common_props to hw/core/cpu.c
There's no reason to keep the property list separate from the CPU class code. Move the variable to hw/core/cpu.c and make it static. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201211220529.2290218-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/core/cpu.c')
-rw-r--r--hw/core/cpu.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/core/cpu.c b/hw/core/cpu.c
index 576fa1d7ba..5c89c858aa 100644
--- a/hw/core/cpu.c
+++ b/hw/core/cpu.c
@@ -393,6 +393,21 @@ static vaddr cpu_adjust_watchpoint_address(CPUState *cpu, vaddr addr, int len)
return addr;
}
+static Property cpu_common_props[] = {
+#ifndef CONFIG_USER_ONLY
+ /* Create a memory property for softmmu CPU object,
+ * so users can wire up its memory. (This can't go in hw/core/cpu.c
+ * because that file is compiled only once for both user-mode
+ * and system builds.) The default if no link is set up is to use
+ * the system address space.
+ */
+ DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION,
+ MemoryRegion *),
+#endif
+ DEFINE_PROP_BOOL("start-powered-off", CPUState, start_powered_off, false),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void cpu_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);