[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/25] cpu: Move cpu_common_props to hw/core/cpu.c
From: |
Eduardo Habkost |
Subject: |
[PULL 12/25] cpu: Move cpu_common_props to hw/core/cpu.c |
Date: |
Tue, 15 Dec 2020 10:19:29 -0500 |
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>
---
hw/core/cpu.c | 15 +++++++++++++++
include/hw/core/cpu.h | 1 -
cpu.c | 15 ---------------
3 files changed, 15 insertions(+), 16 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);
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 3d92c967ff..8e7552910d 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -1111,7 +1111,6 @@ AddressSpace *cpu_get_address_space(CPUState *cpu, int
asidx);
void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...)
GCC_FMT_ATTR(2, 3);
-extern Property cpu_common_props[];
void cpu_exec_initfn(CPUState *cpu);
void cpu_exec_realizefn(CPUState *cpu, Error **errp);
void cpu_exec_unrealizefn(CPUState *cpu);
diff --git a/cpu.c b/cpu.c
index 0be5dcb6f3..0c485cdf2d 100644
--- a/cpu.c
+++ b/cpu.c
@@ -144,21 +144,6 @@ void cpu_exec_unrealizefn(CPUState *cpu)
#endif
}
-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(),
-};
-
void cpu_exec_initfn(CPUState *cpu)
{
cpu->as = NULL;
--
2.28.0
- [PULL 22/25] qdev: Make error_set_from_qdev_prop_error() get Object* argument, (continued)
- [PULL 22/25] qdev: Make error_set_from_qdev_prop_error() get Object* argument, Eduardo Habkost, 2020/12/15
- [PULL 14/25] qdev: Check dev->realized at set_size(), Eduardo Habkost, 2020/12/15
- [PULL 21/25] qdev: Make check_prop_still_unset() get Object* argument, Eduardo Habkost, 2020/12/15
- [PULL 15/25] sparc: Check dev->realized at sparc_set_nwindows(), Eduardo Habkost, 2020/12/15
- [PULL 01/25] vexpress: Register "secure" as class property, Eduardo Habkost, 2020/12/15
- [PULL 16/25] qdev: Don't use dev->id on set_size32() error message, Eduardo Habkost, 2020/12/15
- [PULL 11/25] cs4231: Get rid of empty property array, Eduardo Habkost, 2020/12/15
- [PULL 07/25] arm/cpu64: Register "aarch64" as class property, Eduardo Habkost, 2020/12/15
- [PULL 04/25] i386: Register feature bit properties as class properties, Eduardo Habkost, 2020/12/15
- [PULL 13/25] qdev: Move property code to qdev-properties.[ch], Eduardo Habkost, 2020/12/15
- [PULL 12/25] cpu: Move cpu_common_props to hw/core/cpu.c,
Eduardo Habkost <=
- [PULL 08/25] can_host: Use class properties, Eduardo Habkost, 2020/12/15
- [PULL 25/25] MAINTAINERS: Update my git repository URLs, Eduardo Habkost, 2020/12/15
- [PULL 17/25] qdev: Make PropertyInfo.print method get Object* argument, Eduardo Habkost, 2020/12/15
- [PULL 20/25] qdev: Make qdev_find_global_prop() get Object* argument, Eduardo Habkost, 2020/12/15
- [PULL 23/25] qdev: Make qdev_propinfo_get_uint16() static, Eduardo Habkost, 2020/12/15
- [PULL 19/25] qdev: Make qdev_get_prop_ptr() get Object* arg, Eduardo Habkost, 2020/12/15
- [PULL 24/25] qdev: Move UUID property to qdev-properties-system.c, Eduardo Habkost, 2020/12/15
- [PULL 06/25] virt: Register "its" as class property, Eduardo Habkost, 2020/12/15
- Re: [PULL 00/25] Machine queue, 2020-12-15, Peter Maydell, 2020/12/15