diff options
author | Andreas Färber <afaerber@suse.de> | 2013-01-21 18:26:21 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-01-27 14:52:04 +0100 |
commit | 2b8c27549917b3e07fec5807dbd2b6528ceb4efa (patch) | |
tree | 20fca5c542c32daf4d8479114d76efdcd232f0a1 /qom | |
parent | 2c728dfef56d468a6a80b4dacdfb7109220d2546 (diff) |
cpu: Add model resolution support to CPUClass
Introduce CPUClass::class_by_name and add a default implementation.
Hook up the alpha and ppc implementations.
Introduce a wrapper function cpu_class_by_name().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'qom')
-rw-r--r-- | qom/cpu.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -34,11 +34,24 @@ static void cpu_common_reset(CPUState *cpu) { } +ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model) +{ + CPUClass *cc = CPU_CLASS(object_class_by_name(typename)); + + return cc->class_by_name(cpu_model); +} + +static ObjectClass *cpu_common_class_by_name(const char *cpu_model) +{ + return NULL; +} + static void cpu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); CPUClass *k = CPU_CLASS(klass); + k->class_by_name = cpu_common_class_by_name; k->reset = cpu_common_reset; dc->no_user = 1; } |