qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH RFC v3 06/21] target-arm: Prepare model-specific cla


From: Andreas Färber
Subject: [Qemu-devel] [PATCH RFC v3 06/21] target-arm: Prepare model-specific class_init function
Date: Fri, 3 Feb 2012 03:59:37 +0100

This allows to share initialization between CPU models.

Signed-off-by: Andreas Färber <address@hidden>
---
 target-arm/cpu.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 43231c9..b794ec1 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -96,6 +96,7 @@ static void arm_cpu_reset(CPU *c)
 typedef struct ARMCPUInfo {
     const char *name;
     uint32_t id;
+    void (*class_init)(ARMCPUClass *klass, const struct ARMCPUInfo *info);
 } ARMCPUInfo;
 
 static const ARMCPUInfo arm_cpus[] = {
@@ -230,6 +231,10 @@ static void arm_cpu_class_init(ObjectClass *klass, void 
*data)
     cpu_class->reset = arm_cpu_reset;
 
     k->cp15.c0_cpuid = info->id;
+
+    if (info->class_init != NULL) {
+        (*info->class_init)(k, info);
+    }
 }
 
 static void cpu_register(const ARMCPUInfo *info)
-- 
1.7.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]