aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiajie Chen <c@jia.je>2023-08-21 14:59:58 +0200
committerSong Gao <gaosong@loongson.cn>2023-08-24 11:17:56 +0800
commit6cbba3e9eb3e55353f23cbd567e508d01b7677e0 (patch)
tree7c4e67b8651221c5c4272eb1d10d5c3f1fb4281c
parent19f82a4a6ae6da44fb8167bd3b415025d914f428 (diff)
target/loongarch: Add new object class for loongarch32 cpus
Add object class stub for future loongarch32 cpus. Signed-off-by: Jiajie Chen <c@jia.je> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Song Gao <gaosong@loongson.cn> Message-ID: <20230817093121.1053890-3-gaosong@loongson.cn> [Rebased on TYPE_LOONGARCH64_CPU introduction] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230821125959.28666-8-philmd@linaro.org>
-rw-r--r--target/loongarch/cpu.c11
-rw-r--r--target/loongarch/cpu.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 6384bda1bd..556419f159 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -726,6 +726,10 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data)
#endif
}
+static void loongarch32_cpu_class_init(ObjectClass *c, void *data)
+{
+}
+
static gchar *loongarch64_gdb_arch_name(CPUState *cs)
{
return g_strdup("loongarch64");
@@ -759,6 +763,13 @@ static const TypeInfo loongarch_cpu_type_infos[] = {
.class_init = loongarch_cpu_class_init,
},
{
+ .name = TYPE_LOONGARCH32_CPU,
+ .parent = TYPE_LOONGARCH_CPU,
+
+ .abstract = true,
+ .class_init = loongarch32_cpu_class_init,
+ },
+ {
.name = TYPE_LOONGARCH64_CPU,
.parent = TYPE_LOONGARCH_CPU,
diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
index 3235ad081f..b8af491041 100644
--- a/target/loongarch/cpu.h
+++ b/target/loongarch/cpu.h
@@ -382,6 +382,7 @@ struct ArchCPU {
};
#define TYPE_LOONGARCH_CPU "loongarch-cpu"
+#define TYPE_LOONGARCH32_CPU "loongarch32-cpu"
#define TYPE_LOONGARCH64_CPU "loongarch64-cpu"
OBJECT_DECLARE_CPU_TYPE(LoongArchCPU, LoongArchCPUClass,