target/loongarch: Introduce abstract TYPE_LOONGARCH64_CPU
In preparation of introducing TYPE_LOONGARCH32_CPU, introduce an abstract TYPE_LOONGARCH64_CPU. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230821125959.28666-5-philmd@linaro.org> Signed-off-by: Song Gao <gaosong@loongson.cn>
This commit is contained in:
parent
0b36072786
commit
146f2354b5
@ -734,9 +734,9 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data)
|
||||
#endif
|
||||
}
|
||||
|
||||
#define DEFINE_LOONGARCH_CPU_TYPE(model, initfn) \
|
||||
#define DEFINE_LOONGARCH_CPU_TYPE(size, model, initfn) \
|
||||
{ \
|
||||
.parent = TYPE_LOONGARCH_CPU, \
|
||||
.parent = TYPE_LOONGARCH##size##_CPU, \
|
||||
.instance_init = initfn, \
|
||||
.name = LOONGARCH_CPU_TYPE_NAME(model), \
|
||||
}
|
||||
@ -752,7 +752,13 @@ static const TypeInfo loongarch_cpu_type_infos[] = {
|
||||
.class_size = sizeof(LoongArchCPUClass),
|
||||
.class_init = loongarch_cpu_class_init,
|
||||
},
|
||||
DEFINE_LOONGARCH_CPU_TYPE("la464", loongarch_la464_initfn),
|
||||
{
|
||||
.name = TYPE_LOONGARCH64_CPU,
|
||||
.parent = TYPE_LOONGARCH_CPU,
|
||||
|
||||
.abstract = true,
|
||||
},
|
||||
DEFINE_LOONGARCH_CPU_TYPE(64, "la464", loongarch_la464_initfn),
|
||||
};
|
||||
|
||||
DEFINE_TYPES(loongarch_cpu_type_infos)
|
||||
|
@ -377,6 +377,7 @@ struct ArchCPU {
|
||||
};
|
||||
|
||||
#define TYPE_LOONGARCH_CPU "loongarch-cpu"
|
||||
#define TYPE_LOONGARCH64_CPU "loongarch64-cpu"
|
||||
|
||||
OBJECT_DECLARE_CPU_TYPE(LoongArchCPU, LoongArchCPUClass,
|
||||
LOONGARCH_CPU)
|
||||
|
Loading…
Reference in New Issue
Block a user