[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 09/40] target/arm: Utilize arm-cpu instance_post_init hook
From: |
Richard Henderson |
Subject: |
[RFC PATCH 09/40] target/arm: Utilize arm-cpu instance_post_init hook |
Date: |
Tue, 3 Jan 2023 10:16:15 -0800 |
Rather than call arm_cpu_post_init ourselves from the
object instance_init, let QOM handle this.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index b16d9bbe47..a6c6916f36 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -2245,14 +2245,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void
*data)
#endif /* CONFIG_TCG */
}
-static void arm_cpu_instance_init(Object *obj)
-{
- ARMCPUClass *acc = ARM_CPU_GET_CLASS(obj);
-
- acc->info->initfn(obj);
- arm_cpu_post_init(obj);
-}
-
static void arm_cpu_leaf_class_init(ObjectClass *oc, void *data)
{
ARMCPUClass *acc = ARM_CPU_CLASS(oc);
@@ -2270,7 +2262,7 @@ void arm_cpu_register_parent(const ARMCPUInfo *info,
const char *parent)
.parent = parent,
.instance_size = sizeof(ARMCPU),
.instance_align = __alignof__(ARMCPU),
- .instance_init = arm_cpu_instance_init,
+ .instance_init = info->initfn,
.class_size = sizeof(ARMCPUClass),
.class_init = arm_cpu_leaf_class_init,
.class_data = (void *)info,
@@ -2287,6 +2279,7 @@ static const TypeInfo arm_cpu_type_info = {
.instance_size = sizeof(ARMCPU),
.instance_align = __alignof__(ARMCPU),
.instance_init = arm_cpu_initfn,
+ .instance_post_init = arm_cpu_post_init,
.instance_finalize = arm_cpu_finalizefn,
.abstract = true,
.class_size = sizeof(ARMCPUClass),
--
2.34.1
[RFC PATCH 18/40] target/arm: Create cpreg definition functions with GHashTable arg, Richard Henderson, 2023/01/03
[RFC PATCH 05/40] target/arm: Create arm_cpu_register_parent, Richard Henderson, 2023/01/03
[RFC PATCH 07/40] target/arm: Create TYPE_ARM_V7M_CPU, Richard Henderson, 2023/01/03