[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 16/65] target/hppa: Implement hppa_cpu_class_by_name
From: |
Richard Henderson |
Subject: |
[PATCH v2 16/65] target/hppa: Implement hppa_cpu_class_by_name |
Date: |
Fri, 20 Oct 2023 13:42:42 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/hppa/target_elf.h | 2 +-
target/hppa/cpu.c | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/linux-user/hppa/target_elf.h b/linux-user/hppa/target_elf.h
index 82b4e9535e..19cae8bd65 100644
--- a/linux-user/hppa/target_elf.h
+++ b/linux-user/hppa/target_elf.h
@@ -9,6 +9,6 @@
#define HPPA_TARGET_ELF_H
static inline const char *cpu_get_model(uint32_t eflags)
{
- return "any";
+ return "hppa";
}
#endif
diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index b063255b30..81d51e98b6 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -159,7 +159,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)
--
2.34.1
- [PATCH v2 28/65] target/hppa: Drop attempted gdbstub support for hppa64, (continued)
- [PATCH v2 28/65] target/hppa: Drop attempted gdbstub support for hppa64, Richard Henderson, 2023/10/20
- [PATCH v2 33/65] target/hppa: Decode d for add instructions, Richard Henderson, 2023/10/20
- [PATCH v2 29/65] target/hppa: Remove TARGET_HPPA64, Richard Henderson, 2023/10/20
- [PATCH v2 06/65] target/hppa: Fix hppa64 case in machine.c, Richard Henderson, 2023/10/20
- [PATCH v2 05/65] target/hppa: Remove load_const, Richard Henderson, 2023/10/20
- [PATCH v2 11/65] target/hppa: Fix bb_sar for hppa64, Richard Henderson, 2023/10/20
- [PATCH v2 14/65] target/hppa: Make HPPA_BTLB_ENTRIES variable, Richard Henderson, 2023/10/20
- [PATCH v2 13/65] target/hppa: Introduce TYPE_HPPA64_CPU, Richard Henderson, 2023/10/20
- [PATCH v2 31/65] target/hppa: Decode d for unit instructions, Richard Henderson, 2023/10/20
- [PATCH v2 32/65] target/hppa: Decode d for cmpclr instructions, Richard Henderson, 2023/10/20
- [PATCH v2 16/65] target/hppa: Implement hppa_cpu_class_by_name,
Richard Henderson <=
- [PATCH v2 39/65] target/hppa: Implement LDD, LDCD, LDDA, STD, STDA, Richard Henderson, 2023/10/20
- [PATCH v2 38/65] target/hppa: Decode ADDB double-word, Richard Henderson, 2023/10/20
- [PATCH v2 20/65] target/hppa: Fix hppa64 addressing, Richard Henderson, 2023/10/20
- [PATCH v2 21/65] target/hppa: sar register allows only 5 bits on 32-bit CPU, Richard Henderson, 2023/10/20
- [PATCH v2 23/65] target/hppa: Pass d to do_sub_cond, Richard Henderson, 2023/10/20
- [PATCH v2 35/65] target/hppa: Decode d for bb instructions, Richard Henderson, 2023/10/20
- [PATCH v2 37/65] target/hppa: Decode CMPIB double-word, Richard Henderson, 2023/10/20
- [PATCH v2 26/65] target/hppa: Pass d to do_unit_cond, Richard Henderson, 2023/10/20
- [PATCH v2 24/65] target/hppa: Pass d to do_log_cond, Richard Henderson, 2023/10/20
- [PATCH v2 22/65] target/hppa: Pass d to do_cond, Richard Henderson, 2023/10/20