@@ -22,14 +22,15 @@
#include "hw/core/cpu.h"
-#ifdef TARGET_SPARC64
-#define TYPE_SPARC_CPU "sparc64-cpu"
-#else
#define TYPE_SPARC_CPU "sparc-cpu"
-#endif
+#define TYPE_SPARC32_CPU "sparc32-cpu"
+#define TYPE_SPARC64_CPU "sparc64-cpu"
OBJECT_DECLARE_CPU_TYPE(SPARCCPU, SPARCCPUClass, SPARC_CPU)
+OBJECT_DECLARE_CPU_TYPE(SPARC32CPU, SPARCCPUClass, SPARC32_CPU)
+OBJECT_DECLARE_CPU_TYPE(SPARC64CPU, SPARCCPUClass, SPARC64_CPU)
+
#define SPARC_CPU_TYPE_SUFFIX "-" TYPE_SPARC_CPU
#define SPARC_CPU_TYPE_NAME(model) model SPARC_CPU_TYPE_SUFFIX
@@ -959,6 +959,12 @@ static const TypeInfo sparc_cpu_types[] = {
.abstract = true,
.class_size = sizeof(SPARCCPUClass),
.class_init = sparc_cpu_class_init,
+ }, {
+ .name = TYPE_SPARC32_CPU,
+ .parent = TYPE_SPARC_CPU,
+ }, {
+ .name = TYPE_SPARC64_CPU,
+ .parent = TYPE_SPARC_CPU,
}
};
@@ -975,7 +981,11 @@ static void sparc_register_cpudef_type(const struct sparc_def_t *def)
char *typename = sparc_cpu_type_name(def->name);
TypeInfo ti = {
.name = typename,
- .parent = TYPE_SPARC_CPU,
+#ifdef TARGET_SPARC64
+ .parent = TYPE_SPARC64_CPU,
+#else
+ .parent = TYPE_SPARC32_CPU,
+#endif
.class_init = sparc_cpu_cpudef_class_init,
.class_data = (void *)def,
};