[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/16] target/mips/cpu: Introduce mips_cpu_properties[]
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 04/16] target/mips/cpu: Introduce mips_cpu_properties[] |
Date: |
Mon, 28 Sep 2020 19:15:27 +0200 |
To allow objects creating CPU objects to set non-default properties
before qdev-realizing() it, add an empty mips_cpu_properties array
in MIPSCPUClass.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/cpu.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index e86cd065483..c1c0f2e12ba 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -26,7 +26,7 @@
#include "qemu/module.h"
#include "sysemu/kvm.h"
#include "exec/exec-all.h"
-
+#include "hw/qdev-properties.h"
static void mips_cpu_set_pc(CPUState *cs, vaddr value)
{
@@ -181,6 +181,10 @@ static ObjectClass *mips_cpu_class_by_name(const char
*cpu_model)
return oc;
}
+static Property mips_cpu_properties[] = {
+ DEFINE_PROP_END_OF_LIST()
+};
+
static void mips_cpu_class_init(ObjectClass *c, void *data)
{
MIPSCPUClass *mcc = MIPS_CPU_CLASS(c);
@@ -190,6 +194,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *data)
device_class_set_parent_realize(dc, mips_cpu_realizefn,
&mcc->parent_realize);
device_class_set_parent_reset(dc, mips_cpu_reset, &mcc->parent_reset);
+ device_class_set_props(dc, mips_cpu_properties);
cc->class_by_name = mips_cpu_class_by_name;
cc->has_work = mips_cpu_has_work;
--
2.26.2
- [PATCH 00/16] hw/mips: Set CPU frequency, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 05/16] target/mips/cpu: Set default CPU frequency to 200 MHz, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 04/16] target/mips/cpu: Introduce mips_cpu_properties[],
Philippe Mathieu-Daudé <=
- [PATCH 01/16] hw/core/cpu: Let CPU object have a clock source, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 09/16] hw/mips/mipssim: Correct CPU frequency, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 02/16] target/mips: Move cpu_mips_get_random() with CP0 helpers, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 03/16] target/mips/cp0_timer: Explicit unit in variable name, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 08/16] hw/mips/fuloong2e: Set CPU frequency to 533 MHz, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 06/16] target/mips: Keep CP0 counter in sync with the CPU frequency, Philippe Mathieu-Daudé, 2020/09/28