Skip to content

Commit

Permalink
target/loongarch: Add new object class for loongarch32 cpus
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jiegec authored and gaosong-loongson committed Aug 24, 2023
1 parent 19f82a4 commit 6cbba3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions target/loongarch/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -758,6 +762,13 @@ static const TypeInfo loongarch_cpu_type_infos[] = {
.class_size = sizeof(LoongArchCPUClass),
.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,
Expand Down
1 change: 1 addition & 0 deletions target/loongarch/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6cbba3e

Please sign in to comment.