aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-01-30 23:00:26 +0100
committerPeter Maydell <peter.maydell@linaro.org>2012-03-23 13:39:58 +0000
commit46af5c122513f2ea0d51756d9bd7478ec7e05b39 (patch)
treebf23905285dfb265c044c601411cb46ba57d53e7
parentb931dff862642383e779acb226d0a34403877c65 (diff)
downloadqemu-arm-46af5c122513f2ea0d51756d9bd7478ec7e05b39.tar.gz
target-arm: Prepare model-specific class_init function
This allows to share initialization between CPU models. Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--target-arm/cpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 00b7ecc836..1e34cba27e 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -102,6 +102,7 @@ static void arm_cpu_reset(CPUState *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[] = {
@@ -237,6 +238,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)