Skip to content

Commit

Permalink
target/hppa: Implement hppa_cpu_class_by_name
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Nov 7, 2023
1 parent d3ae32d commit ca4c200
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion linux-user/hppa/target_elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
#define HPPA_TARGET_ELF_H
static inline const char *cpu_get_model(uint32_t eflags)
{
return "any";
return "hppa";
}
#endif
10 changes: 9 additions & 1 deletion target/hppa/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,15 @@ static void hppa_cpu_initfn(Object *obj)

static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model)
{
return object_class_by_name(TYPE_HPPA_CPU);
g_autofree char *typename = g_strconcat(cpu_model, "-cpu", NULL);
ObjectClass *oc = object_class_by_name(typename);

if (oc &&
!object_class_is_abstract(oc) &&
object_class_dynamic_cast(oc, TYPE_HPPA_CPU)) {
return oc;
}
return NULL;
}

static void hppa_cpu_list_entry(gpointer data, gpointer user_data)
Expand Down

0 comments on commit ca4c200

Please sign in to comment.